I did a form, I created a checkbox under the same name 'lead_role' but I can't seem to access it in my javascript validation.
This is the code in my HTML page
<input name="lead_role " id="lead_role" type="checkbox" class="style30" value="1">
And this is the validation I am testing out
alert(document. form1.lead_role .checked);
My browser returns me an 'undefined' alert message.
The only way I was successful in accessing the element is using the getElementById( ) method but that only gets the very first instance of the checkbox.
Can anyone help me out? Thanks :)
This is the code in my HTML page
<input name="lead_role " id="lead_role" type="checkbox" class="style30" value="1">
And this is the validation I am testing out
alert(document. form1.lead_role .checked);
My browser returns me an 'undefined' alert message.
The only way I was successful in accessing the element is using the getElementById( ) method but that only gets the very first instance of the checkbox.
Can anyone help me out? Thanks :)
Comment