View Full Version : accessing form elements

04-20-2007, 08:58 AM
i have this form :

<form name="form1" >
<input type="checkbox" name="usedata_193{1}1" id="usedata_193{1}1" value="1"/>
<input type="button" onclick="sameDataSwitch('193{1}1');"/>

the id on the checkbox has curly braces on it..the problem is i dont know how to access the value of checkbox in javascript..i cant use :
document.form1.usedata_193{1}1 because of the curly braces..are there any ways that i can grab data from elements in a form that has curly braces on their id?

thanks so much

04-20-2007, 02:18 PM
You can use this, which I'm pretty sure is what one is supposed to use according to w3: