CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PopCalendar Help

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related
View previous topic :: View next topic  
Author Message
chrisnetonline



Joined: 24 May 2005
Posts: 13
Location: Massachusetts

PostPosted: Tue May 24, 2005 1:39 pm    Post subject: PopCalendar Help Reply with quote

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
View user's profile Send private message Visit poster's website
chrisnetonline



Joined: 24 May 2005
Posts: 13
Location: Massachusetts

PostPosted: Tue May 24, 2005 2:10 pm    Post subject: Reply with quote

it appears i just needed to upgrade to the latest version.. it seems to be working now
Back to top
View user's profile Send private message Visit poster's website
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Tue May 24, 2005 2:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
chrisnetonline



Joined: 24 May 2005
Posts: 13
Location: Massachusetts

PostPosted: Tue May 24, 2005 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group