erzoolander
asked on
Select Display Text Question
Hi -
We have a form with several SELECT form items within it. We also have a javascript function that changes the selected index based upon certain criteria... For example...
document.getElementById("s tate").sel ectedIndex = 0;
document.getElementById("r egion").se lectedInde x = 0;
Now - the function works...as in it sets the selected index to 0 - but the option value does not update. So - Say for State I choose... "California" with a value of 5. When I reset the value to 0 - it still shows "California" (which it shouldn't) - but the index HAS been changed to 0.
Is there something additional I'm missing - like selectedIndex.text or something? or... document.getElementById("s tate").tex t?
Thanks!
We have a form with several SELECT form items within it. We also have a javascript function that changes the selected index based upon certain criteria... For example...
document.getElementById("s
document.getElementById("r
Now - the function works...as in it sets the selected index to 0 - but the option value does not update. So - Say for State I choose... "California" with a value of 5. When I reset the value to 0 - it still shows "California" (which it shouldn't) - but the index HAS been changed to 0.
Is there something additional I'm missing - like selectedIndex.text or something? or... document.getElementById("s
Thanks!
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
var state1=document.getElement
state1.value=state1.option