0

I have 2 sets of radio buttons which have different data and because they are radios, you can only select a single option per set.

However, I am trying to achieve a setup which will allow only one selection between the 2 sets of radios.

So, if I select an option in set#2, any previously selected option in set#1 will be deselected and vice-versa.

Can anyone help with this?

ps: I know JavaScript should fulfil this need but I am trying to find alternative solutions in case javascript is switched off and the functionality breaks.

2
  • AFAIK javascript is the only option
    – Vimalnath
    Commented Apr 16, 2013 at 9:24
  • vimalnath is right, there's no way to do this without javascript, your only option is to implement this as 1 set of radio buttons, instead of separating it to 2 and trying to force it to be 1 set.
    – Beebee
    Commented Apr 16, 2013 at 9:24

1 Answer 1

0

AFAIK javascript is the only option and I do not see any help in the Drupal webform module

You could do it effectively in javascript/Jquery.

Another option as Beebee suggested you could force all the 4 radio buttons into a single set.

<div id="content">
 <input type=radio name="chooseme" value="1" />
 <input type=radio name="chooseme" value="2"/>
 <input type=radio name="chooseme" value="3"/>
 <input type=radio name="chooseme" value="4"/>
</div>

Now,user would be left to choose any one of the four radios.

1
  • using hook_form_alter and form api #states would be the option I'd take.
    – Beebee
    Commented Apr 16, 2013 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.