i am having three group of radio buttons and using the below code for get the checked value of the radio button. But this takes the all radio buttons as a single group how to seperate and validate using its group name.
$(document).ready(function () {
$("#submit").click(function () {
var x = $("input[type=radio]:checked").val();
});
});
<label><input type="radio" name="present" value="1" />yes</label>
<label><input type="radio" name="present" value="2" />no</label>
<label><input type="radio" name="present" value="3" />No idea</label>
<label><input type="radio" name="outing" value="1" />yes</label>
<label><input type="radio" name="outing" value="2" />no</label>
<label><input type="radio" name="outing" value="3" />No idea</label>
<label><input type="radio" name="member" value="1" />yes</label>
<label><input type="radio" name="member" value="2" />no</label>
<label><input type="radio" name="member" value="3" />No idea</label>
Should be
var x = $("input[type=radio][name='present']:checked").val();for thepresentgroup (modify thenamead lib).