Hi I have the following code, it is supposed to add an option to op4 if the selectedIndex of op2 is 0 and the value of op1 is “blah blah”
Point is, it adds a new option every time, and it’s because the selectedIndex of op2 doesn’t change.
function setJign()
{
var op1 = document.poles.op1;
var op2 = document.poles.op2;
var op3 = document.poles.op3;
var op4 = document.poles.op4;
var $t = op1.options[op1.selectedIndex];
var $v = op2.selectedIndex;
if($v = "0")
{
if($t = "Jig N Pole - $24.00")
{
op4.options[op4.options.length] = new Option('Cork Handle - $1');
alert($v);
}
} else {
op4.options.length = 0;
op4.options[op4.options.length] = new Option('EVA Foam - $0');
}
}
The problem is that the selected index, as reported by the function, doesn’t change.
Firebug says that the selectedIndex changes, but the function doesn’t
Here is a link to the site
http://www.slatersjigs.com/crappie_poles/crappiepoles.php
Please be gentle on the code, I’m new.
Thanks in advance for the help!