worldnews — 2011-08-19T17:06:06-04:00 — #1
Why is the input type = radio on this page is not getting the value assigned to it after the user clicks on the related selection?
Here is the page under development:
dreamdates.com - TOTALLY FREE online dating service - date singles ready for romance and love
felgall — 2011-08-19T19:47:37-04:00 — #2
You are testing data.mygender.value which is undefined as data.mygender is an array and not a single entry.
You should be testing data.mygender[data.myGender.selectedIndex].value in order to read the value of the entry in the array that is currently selected.
worldnews — 2011-08-19T20:28:50-04:00 — #3
But mygender is an input of Radio type and NOT checkbox type, so it is not in an array.
I mean to read its value via Php for example one would do:
$mygender = $_POST['mygender'];
1- I have never seen this in case of Radio value retrieval
2- what would selectedIndex be?
felgall — 2011-08-19T21:44:33-04:00 — #4
Your statement is correct for server side languages since only the selected entry gets passed to the server from radio buttons.
worldnews — 2011-08-20T14:49:15-04:00 — #5
Ok, thanks for clarifying that.
I tell you as a developer one learns a few new things per day