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!

referring to form objects

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
0
0
CA
Hi. I have a some checkboxes that I want to be checked when a button is pressed. I think I can do it like this

document.myform.checkbox1.value="on"

But I'd rather be able to do it using IDs. I tried something like

document.getElementByID("checkbox1_id").value="on"

but that doesn't work. Can anyone help me ?? Thanks
 
top bad, bottom good

document.getElementByID("checkbox1_id").value="on"
document.getElementById("checkbox1_id").value="on"

I've run into this more then once myself, stupid caps....
 
Thanks... How would I set the value of the checkbox ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top