码迷,mamicode.com
首页 > Web开发 > 详细

jquery获取GridView中RadioButton选中的数据

时间:2015-05-29 09:44:34      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

    function selectSingleRadio(rbtn) {           

          var radio = document.getElementsByTagName("radio");            

         var arrAll = document.all;

            for (i = 0; i < arrAll.length; i++) {                

                      if (arrAll[i].type == "radio") {                    

                              arrAll[i].checked = false;

                                                    }           

                                               }            

                              rbtn.checked = true;            

                        //document.getElementById("ctl00_ContentPlaceHolder3_HFNumber").value = rbtn.nextSibling.innerHTML;            

                       // document.getElementById("ctl00_ContentPlaceHolder3_btnUpdate").click();           

                        document.getElementById("<% =HFNumber.ClientID%>").value = rbtn.nextSibling.innerHTML;                                   document.getElementById("<% =Label1.ClientID%>").innerText = rbtn.nextSibling.innerHTML;

              }

  <asp:RadioButton ID="rdb1" name="area" runat="server"   Text=‘<%# Eval("Goodsid")%>‘
                                        GroupName="rbAdress" onclick="selectSingleRadio(this);" />

  <asp:Label ID="Label1" runat="server" Text=" "></asp:Label>用来显示的 前台显示

  <asp:HiddenField  ID="HFNumber" runat="server"/>用来传值的

         string no = HFNumber.Value;后台接受;

jquery获取GridView中RadioButton选中的数据

标签:

原文地址:http://www.cnblogs.com/mingzhu9284/p/4537672.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!