Forums

This topic is locked

HOW TO: Checkboxes Dependent on RadioButton?

Posted 24 Oct 2003 22:55:37
1
has voted
24 Oct 2003 22:55:37 Katherine Williams posted:
I'm really hoping that someone knows how to do this, or can point me in the right direction. Basically, I have a form with 2 radiobuttons and 4 checkboxes. I want the 4 checkboxes selected if the first radiobutton is checked. This is what I came up with using javaScript:

<pre id=code><font face=courier size=2 id=code>&lt;form action="searchresults.asp" name="form1"&gt;
&lt;input type="radio" name="rq" value="0" onClick="if (this.checked) { document.form1.col.checked=true; document.form1.col.checked=true; document.form1.col.checked=true; document.form1.col.checked=true;}"&gt;
&lt;input type="checkbox" name="col" value="dgcoweb"&gt;Site-wide
&lt;input type="checkbox" name="col" value="agendas"&gt;Agendas
&lt;input type="checkbox" name="col" value="minutes"&gt;Minutes
&lt;input type="checkbox" name="col" value="newsrel"&gt;News Releases
&lt;/form&gt;</font id=code></pre id=code>

...but it doesn't work. But I also don't get any error messages. Can anyone see what I'm doing wrong? Thanks.

KWilliams

Reply to this topic