• 通过Jquery获取RadioButtonList选中值


    第一种:通过find方法 获取RadioButtonList所选中的值

    View Code
    1 <script type="text/javascript">
    2         $(document).ready(function () {
    3          //保存之前去验证所有字段是否符合
    4             $("#btn_save").click(function () {
    5                    $("#rbl_sex").find("[checked]").val();
    6                  })
    7          })
    8 </script>

    第二种: 

    View Code
    1 <script type="text/javascript">
    2         $(document).ready(function () {
    3         $("#btn_save").click(function () {
    4            $("input[name='rbl_sex']:checked").val();
    5         })
    6         })
    7 </script>

     HTML:

    View Code
     1 <div class="line">
     2                 <div class="left">
     3                     性别
     4                 </div>
     5                 <div class="mid">
     6                     <asp:RadioButtonList ID="rbl_sex" runat="server" RepeatDirection="Horizontal">
     7                         <asp:ListItem Text=""></asp:ListItem>
     8                         <asp:ListItem Text=""></asp:ListItem>
     9                     </asp:RadioButtonList>
    10                 </div>
    11                 <div class="right">
    12                 </div>
    13 </div>
    14 <asp:Button ID="btn_save" runat="server" Text="提交" />
  • 相关阅读:
    验证码处理 -- 爬虫
    Django知识点总结
    关于sql去重
    tsxt-01
    崔老师爬取top100的源码(会403)
    简单爬取网页源码
    爬取猫眼top100
    python-自动发邮件
    python-装饰器
    Python 爬虫基础Selenium库的使用
  • 原文地址:https://www.cnblogs.com/mystar/p/3028165.html
Copyright © 2020-2023  润新知