View Full Version : Cut & Paste Date Time Picker Calendar

06-26-2015, 09:54 PM
Update: I found out that the onchange event didn't fire. I don't know why...I guess the javascript function of the calendar broke it?


I am trying to use the "Cut & Paste Date Time Picker Calendar" at the link below:


The calendar works fine. The problem is that after a date is selected from the calendar, I am unable to capture the date value of the html textbox field "date1". Below is my php code:

echo '<td align="middle"><input type="text" id="date1" name="date1" onchange="document.myform.planth.value = this.value"/><a href="javascript:NewCal(\'date1\',\'mmddyyyy\')"><img src="c:/xampplite/htdocs/testArea/Hardship/datetimepick/cal.gif" width="20" height="16" border="0" alt="Pick a date"></a>' . '</td></tr>';

Basically, I use the event "onchange" to save the date value to a hidden html text field so that I can display it later after posting the webpage. However, the hidden field is always blank after submitting the form. Note: The $_POST['date1'] of textbox "date1" also shows blank when I debug the code. However, this field does show the date correctly on the webpage.

Was anyone able to capture the date value using this same calendar? Please help out.

Thank you.