vitalets / combodate

Dropdown date and time picker
http://vitalets.github.com/combodate
207 stars 82 forks source link

Parsing the time or date to a database #72

Open antistandard opened 7 years ago

antistandard commented 7 years ago

Hello, This script works well, however, is there a way to pass the time from a form to a mysql database? This is my form field:

<form method="post" action="newUser.php"> etc..
<li><label for="Testing Time">Testing Time</label> <input type="text" id="time" data-format="h:mm a" data-template="hh : mm a" value="0:00 pm" name="testTime" /></li>

Then in the newUser.php file I have: $testTime = filter_var($_POST["testTime"], FILTER_SANITIZE_STRING);

but when I echo out the testTime variable it is empty. All my other fields are populating their variables except passing the time gives me empty results.

Is there a reason why the name on the form is not holding the Combodate text as it passes fromthe form to the php file?

Thank you