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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really stupid question about radio buttons 1

Status
Not open for further replies.

tyrahat

Technical User
Apr 23, 2003
9
0
0
US
I'm new to DW and was thrown this project with a "it better work or else" and unfortunately, don't have time to read the bibles on DW. I greatly appreciate the help!!

I need to do the following: have a set of options, such as:

Visa
Mastercard
Amex

And then have the user select YES or NO (2 radio button columns) whether they have the CC or not and then be able to capture the YES or NO value.

When I try to do radio buttons either (a) I can only chose one entry at a time or (b) don't have a clue how to do a YES and No set (2 radio buttons) unless I do them as Individuals (and not group) but then I don't know how to write the data.

HELP!!!! and a Million thanks!!!!
 
you need to use an array, and catch the value from the array.

Code:
<input type="radio" name="cardtype" value="visa" />
<input type="radio" name="cardtype" value="mastercard" />
<input type="radio" name="cardtype" value="diners" />

you can then get the value via $_REQUEST['cardtype']

----------------------------------------
Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
radio buttons do that, you can only select one, that is their function. Checkboxes let you check more than one.



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Code:
<input type="radio" name="visa" value="yes"> Yes
<input type="radio" name="visa" value="no"> No <br>
<input type="radio" name="mastercard" value="yes"> Yes
<input type="radio" name="mastercard" value="no"> No <br>
<input type="radio" name="diners" value="yes"> Yes
<input type="radio" name="diners" value="no"> No <br>

Cheech


[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top