0

I'm creating a web page in php and I have a question. I have a form:

<form method="post" action="input.php">
.....
Data: <br><input type="date" name="data"  ><br>
Start hour: <br><input type="time" name="starthour" min="09:30:00" max="16:30:00"><br>

End hour:

I would like to create that when the user enters the date automatically a search is performed in the database and all events for that date are shown. I tried using a calendar but I could not find functional for my case. How do you think I can accomplish something like this? Thank you for your attention and for your help.

  • 3
    You can use ajax requests to fetch data – Samarth Saxena Sep 21 '18 at 08:50
  • @SamarthSaxena thanks for your reply. I know this, but I don't know how to do :/ – user10395675 Sep 21 '18 at 08:51
  • 1
    https://stackoverflow.com/questions/5298401/basic-php-and-ajax – Samarth Saxena Sep 21 '18 at 08:58
  • Ok I'm reading something, but I don't understand one thing. Can I check without press a button? I saw only example with it's necessary to click a button – user10395675 Sep 21 '18 at 09:39
  • yes if you want to do the search as soon as the user enters a valid date you can handle the "input" event of the textbox and then check the date is valid, if so you can launch the ajax request. If you are not sure where to start I suggest you study documentation and/or tutorials regarding JavaScript events and AJAX requests. – ADyson Sep 21 '18 at 09:43
  • https://www.youtube.com/watch?v=8mTIuuvOGbY – Samarth Saxena Sep 21 '18 at 09:59

0 Answers0