使用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" />
本文来自博客园,作者:程序猿网友666,转载请注明原文链接:https://www.cnblogs.com/chenghu/archive/2013/01/11/2856428.html


浙公网安备 33010602011771号