script newbie - multiple combo boxes 
Author Message
 script newbie - multiple combo boxes

I have several combo boxes within a form on an asp page.  There are nine in
total in three groups of three.  The first combo contain the 12 months in a
year, the second contains the values 1 to 31, and the third contains years.

When the user selects feb. from the month combo and 29 from the day combo, I
only want the leap year values in the year combo.  So I have a function that
will do this, but I want to make this function reusable for any group of
combo boxes.  For instance, here is the code if the user changes the day
combo:

function ChildDayBirth_OnChange()
 if document.form.ChildDayBirth.selectedIndex = 30 AND
document.form.ChildMonthBirth.selectedindex = 3 Then
  YearLeap
  end if
end function

sub YearLeap()
 dim icnt
 for icnt = 0 to 101
  document.form.ChildYearBirth.remove(1)
 next
 for icnt = 1904 to 2000 step 4
  set oOption = document.createElement("OPTION")
  oOption.text = icnt
  form.ChildYearBirth.add(oOption)
 next
 set icnt = nothing
end sub

What I want to be able to do is call YearLeap from other combo box groups.
I cannot pass the name of the combo to YearLeap and then change the code to
something like document.form.SOMECOMBO.remove(index), that doesn't work.  Is
there a way to do this.  Thanks.

mike



Fri, 09 Nov 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. combo box/database combo box vlaue question - newbie

2. HOW TO: combo box -- multiple selections

3. Combo Boxes w/ Multiple Columns

4. Populating Multiple Combo Boxes

5. Newbie question - Combo box

6. VBScript Newbie : Form Entry using a combo box without submit button

7. VB Script w/Combo Boxes

8. Addding Items to Combo Box in VB Script

9. Filling A Combo Box With VB Script

10. can you drop down combo box throught script

11. enter data in a combo box based on value from another combo box

12. Multiple choices from combo box

 

 
Powered by phpBB® Forum Software