View Full Version : document.form.element.click

06-22-2004, 04:55 AM
<td onmouseover="this.style.cursor='hand';" onclick="document.form.rca[1][0].checked = true; return false;">
<input type="radio" name="rca[1]" value="strongly agree" class="layout">

Does anyone see a problem with that? On my test page I the problem seemed to be naming the input button an array.

06-22-2004, 04:56 AM
whoops, disregard this one

06-22-2004, 05:01 AM
onclick="document.form.elements['rca[1]'][0].checked = true; return false;"

Is there any reason you're using a "bracketed" name? Are you using php?

Learning the square bracket notation (http://www.litotes.demon.co.uk/js_info/sq_brackets.html) is very useful especially in this case.

06-22-2004, 05:03 AM
whoops, disregard this one
I typed slow...But for the benefit of others, could you explain why?

06-22-2004, 02:24 PM
I used getElementById with the radios each unique

06-23-2004, 12:03 AM
edit: fixed new issue

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum