How to get value from RadioButtonList using jQuery?

36.1k views Asked by At

I need to find out what is the selected value of RadioButtonList:

<div class="editor-field radio-button-list">
   <%= Html.RadioButtonListForEnum("Type", Model.Type)%>
</div>

I tried to use: $("#Type").find(":checked").val() but all I get is "undefined"... Any ideas?

4

There are 4 answers

0
Adam Rackis On BEST ANSWER

I'm not sure the id of Type is coming out how you think it is. Or maybe Type is a duplicate Id. In any event, I think this is what you want

$(".editor-field.radio-button-list").find(":checked").val()
0
Sambath Kumar S On

It's working for server side control:

$("#<%=ControlID.ClientID%>").find(":checked").val();
0
iIrfan On
$(".editor-field.radio-button-list:checked").val()
0
rotem On

var val = $('#<%= ControlID.ClientID %> input:checked').val();