View Full Version : Jason's Date Input Calendar - Default value or form value?

09-26-2006, 04:01 PM
1) Script Title: Jason's Date Input Calendar

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm

3) Describe problem: at first thanks to jason for this simple but absolutely great script! it works perfectly, but i wonder if it would be possible to use some different default values. if i have a empty form the script ist ok, but what if i edit some content. example i have stored some date infos in the database and want to edit the data with a form. then the date-input-script always shows the default value (today´s date from server). it would be perfect if it could show the data from the database. do you think this would be possible.

the same problem is if you send the php form and check it. the date-input script does not use the sent data $_POST['name_of_the_field'] but uses the described default value.

would be very nice if someone could help me with this. i am from austria, so excuse my bad english.

01-21-2013, 07:45 AM
I have a mysql variable for a date field, $expire. The following works to fetch the existing date in the database, so when a user uses the edit form and wants to change the date (or anything else), the date is automatically populated from the database.

<script>DateInput('expire', true, 'MM-DD-YYYY', '$expire')</script>