Just use.
$(‘input[name=”name_of_your_radiobutton”]:checked’).val();
It is that easy.
First, you cannot have multiple elements with the same id. I know you said you can’t control how the form is created, but…try to somehow remove all the ids from the radios, or make them unique.
To get the value of the selected radio button, select it by name with the :checked filter.
var selectedVal = “”;
var selected = $(“input[type=’radio’][name=’s_2_1_6_0′]:checked”);
if (selected.length > 0) {
selectedVal = selected.val();
}
EDIT
So you have no control over the names. In that case I’d say put these radio buttons all inside a div, named, say, radioDiv, then slightly modify your selector:
var selectedVal = “”;
var selected = $(“#radioDiv input[type=’radio’]:checked”);
if (selected.length > 0) {
selectedVal = selected.val();
}