...

View Full Version : document.form.element.click



bnovc
06-22-2004, 05: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">
</td>

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

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

glenngv
06-22-2004, 06: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.

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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum