Please help. I need to have the user select 1 and only 1 radio button out of 3 upon submit of form. How can I accopmlish this. Some code I could merge in would be nice.
Give them all the same name. This will allow only one selection.
<input type="radio" name="choose_me">
<input type="radio" name="choose_me"> DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
Great, that should work, but how could I make the form not submit if no item has been selected? I need the user to selected an item before being able to submit the form.
One other thing as well, the code you gave above does indeed work but how can I tell once the form has been emailed to me what selection they choose. They all have the same name (choose_me).
To figure out which one is selected give them a unique value:
<input type="radio" name="choose_me" value="1" selected>
<input type="radio" name="choose_me" value="2">
Add the selected key to one to be choosen by default (it might be checked rather than selected).
Otherwise if you want none selected to start you will need javascript to verify if one was choosen onSubmit DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
I tested it and it works fine. I get the value returned. Please paste the whole code. I bet frontpage is adding the value of on somewhere in the code. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.