View previous topic :: View next topic |
Author |
Message |
chrisnetonline
Joined: 24 May 2005 Posts: 13 Location: Massachusetts
|
Posted: Tue May 24, 2005 1:39 pm Post subject: PopCalendar Help |
|
|
I am using the Classic theme for PopCalendar XP. The product works fine until I add a "header" option to the drop down boxes.
Example:
Code: |
<select name="year">
<option value="">-Year-</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
</select>
|
There's an example on the web site of this being done but I can't figure out how to modify the Classic theme to work like this.
|
|
Back to top |
|
|
chrisnetonline
Joined: 24 May 2005 Posts: 13 Location: Massachusetts
|
Posted: Tue May 24, 2005 2:10 pm Post subject: |
|
|
it appears i just needed to upgrade to the latest version.. it seems to be working now
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Tue May 24, 2005 2:20 pm Post subject: |
|
|
You need a hidden input field to store the selected date, and use the name of it as a prefix to name the 3 dropdowns.
e.g. in the classic demo, we had a hidden input of "arrDate" and another one of "depDate" - therefore the corresponding dropdowns in turn should be prefixed with "arrDate_" and "depDate_".
It's more obvious if you take a look at the fPopCalendar call where we only passed in the reference of the hidden field instead of dropdowns - we then process the dropdowns in the plugin fAfterSelected using the hidden field name as prefix.
So, all you need to do here is either to add a hidden field and prefix your dropdowns, or modify the plugin to let it grap the exact dropdowns. I'd prefer the former one because it's a universal solution and can be applied to arbitrary pages.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
chrisnetonline
Joined: 24 May 2005 Posts: 13 Location: Massachusetts
|
Posted: Tue May 24, 2005 2:45 pm Post subject: |
|
|
I found a bug in the plugins for the Classic theme that does not allow you to have underscores in the prefix name. Here is a fix:
Code: |
function updateHidden(dc) {
var arr=dc.name.split("_");
var prefix=dc.name.replace('_'+arr[arr.length-1],'');
var els=dc.form.elements;
els[prefix].value=fFormatInput(els[prefix+"_year"].options[els[prefix+"_year"].selectedIndex].value,els[prefix+"_mon"].options[els[prefix+"_mon"].selectedIndex].value,els[prefix+"_day"].options[els[prefix+"_day"].selectedIndex].value);
}
|
|
|
Back to top |
|
|
|