Okay no secret, my Javascript ability is lack luster at best.
First off I’m not sure if I need a loop or some code to set the index value..
I have 2 secondary select boxs that are populated by another master select box in PHP.
This new select boxes will only have 2 values, the first is default, the second is the populated data.
When the master select box is changed a javascript function fires to reload the page with the php selected data. The problem is that the I don’t know how to change the selected index of the second boxes to show the retrieved data.
an example of this is seen here: [url]http://www.onlinecdkey.com/orings.php?cat=Fluorocarbon%20%28Brown%29&measure=AS568&duro=75&as568=005
Please look at the Cross Section and Inside Diameter select boxes. You should see data there..
What I need to do is either loop to the end of options, or just add +1 to the selected index since I know the returned results will always be 1 record.
This is my reload function:
[CODE]function reload7(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.measure.options[form.measure.options.selectedIndex].value;
var val3=form.as568.options[form.as568.options.selectedIndex].value;
var val5=form.duro.options[form.duro.options.selectedIndex].value;
self.location=’orings.php?cat=’ + val + ‘&measure=’ + val2 + ‘&duro=’ + val5 + ‘&as568=’ + val3 ;
}
My Cross Section select is named as_cs and my inside diameter is named as_id
I tried adding
form.as_cs.options[form.as_cs.options.selectedIndex].value +1;
and
form.as_cs.options[form.as_cs.options.selectedIndex].value ++;
to the end of the function but that didn’t work.
I assume this is simple, but I’m having trouble finding any examples of some one doing this.