calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Tue Feb 15, 2005 6:57 pm Post subject: [PopCalendarXP]How to set a default date? |
|
|
If you need a default date, assign one directly to the value property of the <input> tag, either in plain HTML, javascript or by asp/jsp/php. The calendar will automatically pick it up when it pops up.
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.
Code: | <body ... onload="document.formName.dateField.value=gfPop.fFormatInput(2003, gfPop.gToday[1], gfPop.gToday[2])"> |
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. |
|