Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

any way to deselect radio buttons on asp form?

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
0
0
US
I have a web form with two options, but only want to allow to select one...Im using radio buttons and I can mark both of them but cannot deselect them....is there any way to do this?

thanks
 
The radio buttons should both have the same "name". Then, you will only be able to select one of the radio buttons, not both. There should be no need to "unselect" a radio button.
 
problem is now when I select either the male or female gender radio button setting the name equal as below:

<input type="radio" name="gender" id="FemaleGender" value="FemaleGender" />

<input type="radio" name="gender" id="MaleGender" value="MaleGender" />

If I select Male Gender when the user receives the email it doesn't record what was selected either male or female

thanks
 
Hi,
How are you populating the Email contents?
Are you including the Value from the button ?

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
the value for one is "MaleGender" and the other is "FemaleGender" once the user hits submit the contents are emailed in the format of:

Registration Form3/22/2011 1:34:31 PM Surname: First Name: Address: City: State: Zip: Phone: Ward: Stake: MaleGender: FemaleGender: FemaleGender Email: Message:
 
Yes, those are the values, but Turkbear asked HOW you are retrieving the values. You will need to post some code.
 
Dim FirstName, Surname, Address, City, StateFrom, Zip, Phone, Ward, Stake, MaleGender, FemaleGender, Email, Message

FirstName = Request.Form("FirstName")
Surname = Request.Form("Surname")
Address = Request.Form("Address")
City = Request.Form("City")
StateFrom = Request.Form("StateFrom")
Zip = Request.Form("Zip")
Phone = Request.Form("Phone")
Ward = Request.Form("Ward")
Stake = Request.Form("Stake")
MaleGender = Request.Form("MaleGender")
FemaleGender = Request.Form("FemaleGender")
Email = Request.Form("Email")
Message = Request.Form("Message")

.....furthur down

With objMessage
.To = "user@to.com"
.From = "user@from.com"
.Subject = "YSA Registration"
.HTMLBody = "Registration Form" & Now() & vbCrLf & "Surname: " & Surname & vbCrLf & "First Name: " & FirstName & vbCrLf & "Address: " & Address & vbCrLf & "City: " & City & vbCrLf & "State: " & StateFrom & vbCrLf & "Zip: " & Zip & vbCrLf & "Phone: " & Phone & vbCrLf & "Ward: " & Ward & vbCrLf & "Stake: " & Stake & vbCrLf & "MaleGender: " & MaleGender & vbCrLf & "FemaleGender: " & FemaleGender & vbCrLf & "Email: " & Email & vbCrLf & "Message: "& Message
.Send
 
Dim FirstName, Surname, Address, City, StateFrom, Zip, Phone, Ward, Stake, MaleGender, FemaleGender, Gender, Email, Message

FirstName = Request.Form("FirstName")
Surname = Request.Form("Surname")
Address = Request.Form("Address")
City = Request.Form("City")
StateFrom = Request.Form("StateFrom")
Zip = Request.Form("Zip")
Phone = Request.Form("Phone")
Ward = Request.Form("Ward")
Stake = Request.Form("Stake")
MaleGender = Request.Form("MaleGender")
FemaleGender = Request.Form("FemaleGender")

Gender = Request.Form("gender")
Email = Request.Form("Email")
Message = Request.Form("Message")

.....furthur down

With objMessage
.To = "user@to.com"
.From = "user@from.com"
.Subject = "YSA Registration"
.HTMLBody = "Registration Form" & Now() & vbCrLf & "Surname: " & Surname & vbCrLf & "First Name: " & FirstName & vbCrLf & "Address: " & Address & vbCrLf & "City: " & City & vbCrLf & "State: " & StateFrom & vbCrLf & "Zip: " & Zip & vbCrLf & "Phone: " & Phone & vbCrLf & "Ward: " & Ward & vbCrLf & "Stake: " & Stake & vbCrLf & "MaleGender: " & MaleGender & vbCrLf & "FemaleGender: " & FemaleGender & vbCrLf "Gender: " & Gender & vbCrLf & "Email: " & Email & vbCrLf & "Message: "& Message
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top