Joined: 30 Jan 2005
|Posted: Tue Feb 15, 2005 6:57 pm Post subject: [PopCalendarXP]How to set a default date?
Be sure to use the date format in accordence with the settings in the calendar theme you use, otherwise the calendar won't recognize it and will just have it cleared.
If you leave the field empty, the calendar will try to populate it with the gdSelect option defined in your theme file when it pops up.
The following code example sets the default date to be the same date of today but always in year 2003.
|<body ... onload="document.formName.dateField.value=gfPop.fFormatInput(2003, gfPop.gToday, gfPop.gToday)"> |
Other than setting the onload event handler in the <body> tag of your page, you may also choose to set the onload of the <iframe> tag instead. But please do note that the onload of iframe tag is not supported by all browsers.
Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.