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><form action="searchresults.asp" name="form1">
<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;}">
<input type="checkbox" name="col" value="dgcoweb">Site-wide
<input type="checkbox" name="col" value="agendas">Agendas
<input type="checkbox" name="col" value="minutes">Minutes
<input type="checkbox" name="col" value="newsrel">News Releases
</form></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