Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check dropdown box

Status
Not open for further replies.

techu4

Technical User
Jun 27, 2005
32
GB
Hi,

I have a form that is made up of divs that are shown or hidden dependant on what has been selected in the form.

In the first div I have a dropdown box with 2 options and the first one is selected by default.

On the 5th div I have a button that when pressed needs to check what was selected in the dropdown box and do different this dependant on what that selection was.

Here is the code i am using that does not seem to work:

Code:
var frm2 = document.forms[0];

if(frm2.joint.selectedIndex == 0) {
showLayer('page15');
}
if(frm2.joint.selectedIndex == 1) {
showLayer('page6');
}

It always behaves as though the selected index is 1 regardless of what the actual selection is.

Can anyone help

Cheers
Techu4
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top