1) Script Title:
Jasons Date Input Calendar
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamici...oncalendar.htm
3) Describe problem:
I am trying to pass the value from the calendar to a PHP variable using the $_POST, so that I can insert it into a MySQL database, however, it always submits the default value (today). Even after you select the date from the calendar, it still posts the default date. Here are the bits of code I used:
in Header section:
to call the script:Code:<!-- java script for calendar--> <script type="text/javascript" src="calendarDateInput.js"> /*********************************************** * Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm * Script featured on and available at http://www.dynamicdrive.com * Keep this notice intact for use. ***********************************************/ </script>
to retrieve value after submitting form:Code:<td><script>DateInput('startdate', true, 'YYYY-MM-DD')</script></td> <input type="button" id="startdate" onclick="alert(this.form.startdate.value)" value="Show date value passed">
Can anyone help?Code:$startdate = (isset($_POST['startdate'])) ? ($_POST['startdate']) : '';
Thanks
Amit
MODS please close




Reply With Quote

Bookmarks