Form - how allow multiple option button selection

  • Thread starter Thread starter DianaH
  • Start date Start date
D

DianaH

I have a form on a site with some option (radio) buttons added. How do I
set it up so that the person submitting the form can select more than one
option button (radio button).

Thanks.
 
DianaH said:
I have a form on a site with some option (radio) buttons added. How
do I set it up so that the person submitting the form can select more
than one option button (radio button).

Thanks.

I think by definition only one of a set of radio buttons can be selected.

They get their name from the old pushbuttons which used to be on radios to
select a different station or other things such as volume or tone. They were
mechanically linked so that when one was pressed, all others were released.
The same principle applies here, but progarmatically.

But don't give up. Just use normal buttons <input type ="button" ...>.
You can have as many of these selected as you like, although you may want to
write JS code to test certain combinations,
e.g. a button "Do you want to select some items"
and another set
"Item 1"
"Item 2"
"Item 3"
A No to the first implies the second set must all be unselected.
A Yes to the first implies at least one of the second set must be selected.
 
Trevor.
Thanks for the history behind the buttons ... didn't know that, but it makes
sense. I thought there would be an option to allow multiple choices, but
you explained that this isn't the case.

What I just figured out (after a long time of searching) is to use
checkboxes instead of the radio buttons - as the checkboxes allow multiple
selections. The radio buttons look better, but these work. Thanks for your
help.

DianaH said:
I have a form on a site with some option (radio) buttons added. How
do I set it up so that the person submitting the form can select more
than one option button (radio button).

Thanks.

I think by definition only one of a set of radio buttons can be selected.

They get their name from the old pushbuttons which used to be on radios to
select a different station or other things such as volume or tone. They were
mechanically linked so that when one was pressed, all others were released.
The same principle applies here, but progarmatically.

But don't give up. Just use normal buttons <input type ="button" ...>.
You can have as many of these selected as you like, although you may want to
write JS code to test certain combinations,
e.g. a button "Do you want to select some items"
and another set
"Item 1"
"Item 2"
"Item 3"
A No to the first implies the second set must all be unselected.
A Yes to the first implies at least one of the second set must be selected.
 
You need to use check boxes not radio buttons. by design, radio buttons are
"traditionally" for a "pick one only" choice or a Yes/No, On/Off kind of
thing. You can't make multiple choices with radio buttons, but you can with
the check(tick) boxes.

All you need to do is

<input type="checkbox" name="city" value="Chicago">
<input type="checkbox" name="city" vaue="London">
etc within a form.

You can also use the dropdown box and set it for "multiple selections".
 
Thanks Andrew.
You are right.

You need to use check boxes not radio buttons. by design, radio buttons are
"traditionally" for a "pick one only" choice or a Yes/No, On/Off kind of
thing. You can't make multiple choices with radio buttons, but you can with
the check(tick) boxes.

All you need to do is

<input type="checkbox" name="city" value="Chicago">
<input type="checkbox" name="city" vaue="London">
etc within a form.

You can also use the dropdown box and set it for "multiple selections".
 
Back
Top