Setting radio button to checked if another is checked

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Setting radio button to checked if another is checked

Post by voltrader »

I have a form with two sets of radio buttons, group1 and group2.

On a check of a button in group2, I would like a certain radio button in group1 to be automatically checked.

To get option1 button in group1 to be automatically checked upon a check of option1 button in group2, can I do this?

<input type='radio' name='group2' value='option1' onclick="document.group1.radio1.checked=true;">
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

SOLVED

Post by voltrader »

excellent -- thanks.

onclick="document.formname.group[0].checked=true" did the job.
Post Reply