zoukankan      html  css  js  c++  java
  • 使用jquery 获取RadioButtonList 中选中值

    方法1:摘自网络

    View Code
    <mce:script language="javascript"><!--
            $(document).ready(function() {
    
                $("#btnSubmit").click(function() {
    
                    alert($("#RadioButtonList1").find("input[@checked]").val());
    
                });
    
            });
    
        
    // --></mce:script>
    
     
    
    <asp:RadioButtonList ID="RadioButtonList1" runat="server">
    
            <asp:ListItem>1</asp:ListItem>
    
            <asp:ListItem>2</asp:ListItem>
    
            <asp:ListItem>3</asp:ListItem>
    
        </asp:RadioButtonList>
    
         <input id="btnSubmit" type="button" value="Submit" />

    方法2:原创

    View Code
    var rubricType = $("input[name='rblRubricType']:checked").val();
    
    <mce:script language="javascript"><!--
            $(document).ready(function() {
                $("#btnSubmit").click(function() {
                    alert($("input[name='RadioButtonList1']:checked").val());
                });
            });
    // --></mce:script>
    
    <asp:RadioButtonList ID="RadioButtonList1" runat="server">
            <asp:ListItem>1</asp:ListItem>
            <asp:ListItem>2</asp:ListItem>
            <asp:ListItem>3</asp:ListItem>
    </asp:RadioButtonList>
    
    <input id="btnSubmit" type="button" value="Submit" />
  • 相关阅读:
    5,7地面物品
    0,1选怪
    0,2使用红,蓝
    BT地址(__)
    3,7包裹物品数组
    0,4捡物
    如何在目标内网中发现更多存活主机
    xss自动化攻击
    .NET Framework 4安装失败
    利用struts1.x框架需要注意的问题
  • 原文地址:https://www.cnblogs.com/chenghu/p/2856428.html
Copyright © 2011-2022 走看看