asp.net使用jQuery獲取RadioButtonList成員選中內(nèi)容和值示例
更新時(shí)間:2014年01月13日 11:30:01 作者:
這篇文章主要介紹了通過(guò)jQuery來(lái)獲取RadioButtonList成員內(nèi)容的方法,大家參考使用吧
復(fù)制代碼 代碼如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.8.2.min.js" type="text/javascript"></script>
<link href="Base.css" rel="stylesheet" type="text/css" />
<style type="text/css">
</style>
<script type="text/javascript">
$(document).ready(function () {
$("#<%=rblHobbies.ClientID%> input[type=radio]").bind("change", function () {
if ($(this).val() != "") {
$("#message").text("Text:" + $(this).next().text() + " Value:"+$(this).val());
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div style="margin: 100px auto; width: 400px; height: 200px;">
<fieldset style="width: 400px; height: 150px">
<p>
請(qǐng)選擇愛(ài)好</p>
<asp:RadioButtonList ID="rblHobbies" runat="server" >
<asp:ListItem Value="1">音樂(lè)</asp:ListItem>
<asp:ListItem Value="2">籃球</asp:ListItem>
<asp:ListItem Value="3">美劇</asp:ListItem>
<asp:ListItem Value="4">電影</asp:ListItem>
</asp:RadioButtonList >
</fieldset>
<br />
<div id="message" style="color:blue;"></div>
</div>
</form>
</body>
</html>
您可能感興趣的文章:
- jQuery中select與datalist制作下拉菜單時(shí)的區(qū)別淺析
- jquery ajax后臺(tái)返回list,前臺(tái)用jquery遍歷list的實(shí)現(xiàn)
- 基于MVC5和Bootstrap的jQuery TreeView樹(shù)形控件(一)之?dāng)?shù)據(jù)支持json字符串、list集合
- jQuery插件datalist實(shí)現(xiàn)很好看的input下拉列表
- JqueryMobile動(dòng)態(tài)生成listView并實(shí)現(xiàn)刷新的兩種方法
- CheckBoxList多選樣式j(luò)query、C#獲取選擇項(xiàng)
- Jquery操作下拉框(DropDownList)實(shí)現(xiàn)取值賦值
- jQuery接受后臺(tái)傳遞的List的實(shí)例詳解
相關(guān)文章
獲取Repeter的Item和ItemIndex/CommandArgument實(shí)現(xiàn)思路與代碼
Repeater控件,放在ItemTemplate內(nèi)的銨鈕OnClick之后,獲取Repeater的Item,ItemIndex,CommandArgument,CommandName以及綁定的字段值附演示動(dòng)畫(huà)感興趣的朋友可以了解下2013-01-01ASP.NET調(diào)用WebService服務(wù)的方法詳解
這篇文章主要介紹了ASP.NET調(diào)用WebService服務(wù)的方法,較為詳細(xì)的分析了WebService服務(wù)的功能,創(chuàng)建步驟與使用方法,需要的朋友可以參考下2016-05-05asp.net 擴(kuò)展GridView 增加單選按鈕列的代碼
asp.net 擴(kuò)展GridView 增加單選按鈕列的代碼2010-02-02ASP.NET Core MVC獲取請(qǐng)求的參數(shù)方法示例
這篇文章主要給大家介紹了關(guān)于ASP.NET Core MVC是如何獲取請(qǐng)求的參數(shù),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用ASP.NET Core MVC具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05asp.net性能優(yōu)化之使用Redis緩存(入門)
本文主要介紹了asp.net性能優(yōu)化之使用Redis緩存的相關(guān)知識(shí)。具有很好的參考價(jià)值,下面跟著小編一起來(lái)看下吧2017-03-03Asp.net mvc 權(quán)限過(guò)濾和單點(diǎn)登錄(禁止重復(fù)登錄)
這篇文章主要介紹了Asp.net mvc 權(quán)限過(guò)濾和單點(diǎn)登錄(禁止重復(fù)登錄)的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-12-12解協(xié)議時(shí)有符號(hào)和無(wú)符號(hào)整數(shù)型處理
這篇文章主要介紹了解協(xié)議時(shí)有符號(hào)和無(wú)符號(hào)整數(shù)型處理,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-01-01