Jump to content

JS radio button value, not passing


coupe-r

Recommended Posts

I have 2 gender radio buttons:

 

<input name="gender" type="radio" <?php if(isset($gender_error)) { echo 'class="textboxError"'; } else { echo 'class="glow"'; } ?> id="gender" value="Male" <?php if(isset($gender) && $gender == 'Male') {echo 'checked="checked"';} ?> />Male 

<input name="gender" type="radio" <?php if(isset($gender_error)) { echo 'class="textboxError"'; } else { echo 'class="glow"'; } ?> id="gender" value="Female" <?php if(isset($gender) && $gender == 'Female') {echo 'checked="checked"';} ?> />Female

 

I'm passing the checked value to another PHP page via jquery:

 

gender:	document.form1.gender.value

 

This should echo our Male, but never does.  If I make it gender[0].value, it then echos Male, if I make it gender[1] it echos Female because I'm telling it the position.

 

I'm guessing I need to change gender: document.form1.gender.value slightly, just not sure how.

 

Any Ideas?

Link to comment
https://forums.phpfreaks.com/topic/245080-js-radio-button-value-not-passing/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.