Failing miserably to read radio value despite previous examples
Folks,
I have used the example listed on the api page:
http://api.jquery.com/val/
$( "input:radio[name=bar]:checked" ).val();
but I don't get a value (I get nothing, not "undefined", not 0, nothing).
My html is as follows:
Yes<input type="radio" name="ProductExtraActive" id="ProductExtraActiveY" value="Y" checked>
No<input type="radio" name="ProductExtraActive" id="ProductExtraActiveN" value="N">
Some of my attempts that have returned empty:
$( "input:checked" ).val();
$( "input:radio" ).each(
function()
{
var xyz=$(this).val();
alert(xyz);
});
var xyz=$( "input[type=radio]:checked" ).val();
alert(xyz);
I have tried referencing the name, the class, tried using "each" to trap attr("checked") and found a length of 1, but the value was empty.
Cans someone put me out of my misery?
Thanks!