PDA

View Full Version : Jason's Date Input Calendar



mikekist
07-14-2008, 11:01 AM
1) Script Title: Jason's Date Input Calendar

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

3) Describe problem: This script does a great job when inputting dates to a form/database but I would like to be able to change the date view on the form based on dates retrieved from a database.

Does anyone have any ideas on how to do this?

Thanks,
Mike

developer96
08-03-2008, 09:23 PM
Hi Mike,

Yes, you can change the date in form (to show users).

i.e. you use DateInput('myDate',true,'YYYY-mm-dd')

then do following:

1. when you get a date from database, break it into day, month and year.

then..

myDate_Day_ID.selectedIndex=day - 1 (index starts with 0 so you have to date - 1)

myDate_Month_ID.selectedIndex=month - 1

myDate_Year_ID.value = year

So first, create the dateinput and then change it. dont try to change it before you create.



KP

dd_r45jiji
08-27-2008, 04:09 AM
:)
Hi,

Can this script be modified to retrieve the date from the database, prefill the drop menus with those values and then allow the user to correct the date.
After the correction, the values should be able to be update to the database again.

Thanks