SirChick Posted July 22, 2007 Share Posted July 22, 2007 I have 2 radio buttons in a group named Gender one being male and one being female, now how would i get the value from the user's choice out of the two radio buttons and assign it to an $Gender variable..? Link to comment https://forums.phpfreaks.com/topic/61298-radio-button-group-value-caption/ Share on other sites More sharing options...
dbo Posted July 22, 2007 Share Posted July 22, 2007 $gender = $_POST['radio_button_group_name_thing']; that is assuming your form uses the post method. Link to comment https://forums.phpfreaks.com/topic/61298-radio-button-group-value-caption/#findComment-305009 Share on other sites More sharing options...
dbo Posted July 22, 2007 Share Posted July 22, 2007 Or hrmm... is it like checkboxes and returns "on"? I forget. Link to comment https://forums.phpfreaks.com/topic/61298-radio-button-group-value-caption/#findComment-305011 Share on other sites More sharing options...
spode Posted July 22, 2007 Share Posted July 22, 2007 the result SHOULD be automaticaly assigned to the variable using $gender = $_POST['gender_thingy']; because i'm pretty sure it doesnt matter on the type of input, the result is just what is assigned to the variable Link to comment https://forums.phpfreaks.com/topic/61298-radio-button-group-value-caption/#findComment-305014 Share on other sites More sharing options...
SirChick Posted July 22, 2007 Author Share Posted July 22, 2007 whats the 'gender_thingy' is that the group name ? Link to comment https://forums.phpfreaks.com/topic/61298-radio-button-group-value-caption/#findComment-305015 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.