calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Tue Feb 15, 2005 7:42 pm Post subject: [PopCalendarXP]How can I pre-select a date and format it in the corresponding date field? |
|
|
You'll need the following function and have to call it from the onload event of your html body tag. And that's because the calendar engine reference (gfPop) will not be available until the page is fully loaded. e.g. The following code preset the datefield1 with date Dec 10, 2005, whose format depends on the theme being used:
Code: | <body onload="fPresetDate(document.form1.datefield1,2005,12,10);">
<script>
function fPresetDate(field,y,m,d) {
field.value=gfPop.fFormatInput(y,m,d);
}
</script> |
Of course, you can also replace the preset date (2005,12,10) with server-side generated variables, using either ASP, JSP or PHP etc.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|