开发者

How to have the value of the selected in radioButtonList

开发者 https://www.devze.com 2023-03-13 05:37 出处:网络
<html> <asp:RadioButtonList runat=\"server\" CssClass=\"status_Veh\"> <asp:ListItem ID=\"RadioButton1\" runat=\"serve开发者_运维技巧r\" name=\"status\"Selected=\"True\" Value=\"New\">
<html>
<asp:RadioButtonList runat="server" CssClass="status_Veh">
        <asp:ListItem ID="RadioButton1" runat="serve开发者_运维技巧r" name="status"   Selected="True" Value="New">New</asp:ListItem>
        <asp:ListItem ID="RadioButton2" runat="server" name="status"    Value="Used" >Used</asp:ListItem>
    </asp:RadioButtonList>
</html>

need to have the selected value of the radio buttonList using Jquery

I'm using

var statusVeh = $(".status_Veh option:selected ").val();

it isn't working

nor is

var statusVeh = $(".status_Veh:checked").val();


Try $(".status_Veh input:checked").val();

RadioButtonList generates , so the option:selected selector won't work.

$(".status_Veh:checked").val() is not working, because you have to look the .status_Veh elements children for checked values. So $(".status_Veh :checked").val() should also work (notice the space in the selector).


you can try $('input[name=status]:checked').val()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号