php radio post wrong same value after submit
I'm facing a strange error which I cannot figure out. I have a form that
submits a set of 2 radio buttons 1 male other female like this:
<label class="radio">
<input type="radio" name="gender" id="femaleRadio" value="f">
Vrouw
</label>
<label class="radio">
<input type="radio" name="gender" id="maleRadio" value="m">
Man
</label>
Through jQuery AJAX I send it to php... but when I echo the post it always
shows that male is selected. Even if I selected the female. Why is this?
$gender = strip_tags(trim($_POST['gender']));
echo $gender; exit;
I always get M. If I remove the male option in HTML, I get F. This must
have a simple solution but I cannot find it.
Sunday, August 18, 2013
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment