| | |
|
|
|
radio button problem |
| message from anastazia24 on 20 Jul 2004 |
I am testing my site and on my online form I have radio buttons to answer
questions. When you click on the radio button you cannot unselect by clicking
on it again. It remains selected. Why is it doing that and what can I do to
solve that problem?
Thank you.
|
| CarlGrint replied to anastazia24 on 20 Jul 2004 |
Radio buttons work in groups of 2 or more, so you can chose one or the other
option, you could change it to a Tick Box instead if you wish for the option to
unselect it, or you could add a Clear form button.
Originally posted by: anastazia24
I am testing my site and on my online form I have radio buttons to answer
questions. When you click on the radio button you cannot unselect by clicking
on it again. It remains selected. Why is it doing that and what can I do to
solve that problem?
Thank you.
|
| Michael Fesser replied to anastazia24 on 20 Jul 2004 |
.oO(anastazia24)
That's not a problem, that's the way radio buttons work. One of them has
always to be selected. If there's only one then you might want to use a
checkbox instead.
Micha
|
| anastazia24 replied to anastazia24 on 20 Jul 2004 |
So when you say same name, you mean name the textfield the same name???? How can I use the formmail to know what the answer is then?
|
| Michael Fesser replied to anastazia24 on 20 Jul 2004 |
.oO(anastazia24)
Nope, radio buttons have to share the same name if they belong together,
e.g.
<input type="radio" name="set_one" value="1">
<input type="radio" name="set_one" value="2">
<input type="radio" name="set_two" value="1">
<input type="radio" name="set_two" value="2">
This creates two groups of radio buttons. After submitting the form
there are two variables available in the form processing script, named
set_one and set_two, each of them set to either 1 or 2, dependent on the
selected button.
Micha
|
| Murray *TMM* replied to Michael Fesser on 20 Jul 2004 |
Also, you can have three buttons - yes, no, and clear. They start life with
the clear selected. Clicking yes, or no, unsets the clear and selects the
yes or no, respectively. To clear your selection, you just ... should I go
on?
|
| Libbi Bosworth replied to anastazia24 on 20 Jul 2004 |
i may be wrong, but i think radio buttons are named after the "old fashion"
(when I was a kid) radio buttons from cars. You have to select a different
button for it to return to the blank button.
i'd like to know if i'm incorrect.
Libbi
"anastazia24" <webforumsuser@macromedia.com> wrote in message
news:cdjq53$nlr$1@forums.macromedia.com...
|
| Mick White replied to Libbi Bosworth on 20 Jul 2004 |
They still work that way...
Mick
You have to select a different
|
| Julian Roberts replied to anastazia24 on 20 Jul 2004 |
What you'd do is have several radio button with the same name. When a user
selects one answer, it unselects the other selected answer.
|
|
Archived message: radio button problem (Macromedia Dreamweaver Web Design)