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

Netscape navigator checkbox

Status
Not open for further replies.

iooo

Programmer
Dec 27, 2000
31
0
0
CA
Hi
what is the way we can make a checkbox checked or unchecked when user clicks a button in netscape navigator using javascript ..

it works with IE
document.formname.item("checkbox").checked=true;

but same code does not work with Netscape
can anyone suggest me what to do

Thanks
 
Well, you should take out the parenthesis.

By that, I mean if your checkbox is named 'myCheckbox', and your form was named 'myForm', then the code would be:
Code:
document.myForm.myCheckbox.checked = true

hope it helps!:)
Paul Prewett
 
Note that if you are using Netscape "6" you can also do it like this:

document.getElementByID("elementID").checked = true;

where elementID is the ID="" part of your form box/element (similiar to NAME="") Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top