M
Melbfella
G'day all
I apologise in advance for the newbiness of this question, but the
answer has eluded me for 3 days now - hopefully one of you gurus out
there might be able to help .......
I have a page that dynamically draws checkboxes with a combo. I'm
then
attempting to use the following code to iterate through each combo
box
and change the value to match the text box.
Here's the code that calls the functions, and the
functions themselves......
**Code that fires the event
<input class="ctlstandard" type="text" name="txtSeats" id="txtSeats"
onblur="setOptionCombos);"/> <font color="<
%=session("BrandTextColour")%>">*</font></td>
**The function
function setOptionCombos(){
var lSeats=frmMain.txtSeats.value;
for (i=0;i<frmMain.cboTourOptionQty.length;i++){
frmMain.cboTourOptionQty.selectedIndex=lSeats-1;
}
}
This works if there are two combos on the screen, but does not when
there's only one. It seems the event doesn't, although all get
changed
quite happily when there's 2 or more.
If there are 2 combos, the expression
frmMain.cboTourOptionQty.length=2
If there's only 1 combo, the expression
frmMain.cboTourOptionQty.length=100 (the number of options in the
list)
Any help or thoughts would be greatly appreciated
Cheers,
Doug.
I apologise in advance for the newbiness of this question, but the
answer has eluded me for 3 days now - hopefully one of you gurus out
there might be able to help .......
I have a page that dynamically draws checkboxes with a combo. I'm
then
attempting to use the following code to iterate through each combo
box
and change the value to match the text box.
Here's the code that calls the functions, and the
functions themselves......
**Code that fires the event
<input class="ctlstandard" type="text" name="txtSeats" id="txtSeats"
onblur="setOptionCombos);"/> <font color="<
%=session("BrandTextColour")%>">*</font></td>
**The function
function setOptionCombos(){
var lSeats=frmMain.txtSeats.value;
for (i=0;i<frmMain.cboTourOptionQty.length;i++){
frmMain.cboTourOptionQty.selectedIndex=lSeats-1;
}
}
This works if there are two combos on the screen, but does not when
there's only one. It seems the event doesn't, although all get
changed
quite happily when there's 2 or more.
If there are 2 combos, the expression
frmMain.cboTourOptionQty.length=2
If there's only 1 combo, the expression
frmMain.cboTourOptionQty.length=100 (the number of options in the
list)
Any help or thoughts would be greatly appreciated
Cheers,
Doug.