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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selection

Status
Not open for further replies.

transtech

Programmer
Aug 21, 2001
23
0
0
US
HI all,

Can somebody please tell me how do you deselection a selection value and reassign it to a new one. I have the code that works on IE but not on NS. Please help me. I'll be appreciated.

document.test2.Permission.options[0].selected=false;
document.test2.Permission.options[1].selected = true;

thanks,

evan
 
Looks good to me. Try this.

Remove the selected=false statement. You won't need that. the selected=true statement will automatically deselect the current option.

If it still doesn't work in NS, type

javascript:

into your url and press enter. Netscape will display an error log. If the error log is too big, clear the log, try your function again and look at the log again. See if netscape is generating any errors.

TW
 
Hi ToddWW,

Thanks for the answer, but i still get this: document.'form' has no property.

I am using the dhtml's hide and show. So i put two form in two different (DIV)s. and i want to swap these two form based on the change of the selection
Please let me know what can i do about this.

thanks,
evan
 
You're going to lose me there with DHTML. Instead of using a name reference to the form, have you played with the direct form reference.

Something like this.

document.forms[0].Permission.options[1].selected = true;

It is a zero based index so forms[0] would represent the first form on the page, forms[1] would represent the second, and so on..

I have had problems in the past, and maybe with NS, in using named references to forms.

Hope this helps as I am all thumbs when it comes to DHTML.

TW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top