Jump to content

Form Question


moriahcgibbs

Recommended Posts

i made a simple survey form and i cant figure out how to make radio buttons work correctly in the form. All of the input is text, but there is one question on the form that asks for gender. I am a noob to php and i cant figure out how to make the radio buttons work.please help.

Link to comment
Share on other sites

for the radio button you can put this on your input form..

<input type="radio" name="gender" value="m"> Male<br><input type="radio" name="gender" value="f"> Female<br>

if you want use combo box..

<select name="gender">  <option value="m">Male</option>  <option value="f">Female</option></select>

then in php..

//this always worksecho $_REQUEST['gender']; //this works on POST method forms onlyecho $_POST['gender']; //this works on GET method forms onlyecho $_GET['gender'];

you'll get 'm' or 'f'...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...