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?
$("input[name='Surv_Q"+i+"']:checked"). next('label'). text(); jquery.
We can check the status of a radio button by using the :checked jQuery selector together with the jQuery function is . For example: $('#el').is(':checked') . It is exactly the same method we use to check when a checkbox is checked using jQuery.
Using Input Radio checked property: The Input Radio checked property is used to return the checked status of an Input Radio Button. Use document. getElementById('id'). checked method to check whether the element with selected id is check or not.
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()
It's working for server side control:
$("#<%=ControlID.ClientID%>").find(":checked").val();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With