gpt4 book ai didi

jquery - 从 asp :RadioButtonList using jQuery 读取所选值

转载 作者:行者123 更新时间:2023-12-03 21:28:18 32 4
gpt4 key购买 nike

我有类似于以下的代码...

<p><label>Do you have buffet facilities?</label>
<asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:RadioButtonList></p>
<div id="HasBuffet">
<p><label>What is the capacity for the buffet?</label>
<asp:RadioButtonList ID="radBuffetCapacity" runat="server">
<asp:ListItem Text="Suitable for upto 30 guests" value="0 to 30"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 50 guests" value="30 to 50"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 75 guests" value="50 to 75"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 100 guests" value="75 to 100"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 150 guests" value="100 to 150"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 250 guests" value="150 to 250"></asp:ListItem>
<asp:ListItem Text="Suitable for upto 400 guests" value="250 to 400"></asp:ListItem>
</asp:RadioButtonList></p>
</div>

我想在单选列表 blBuffetMealFacilities:chk 更改客户端时捕获事件,并从 jQuery 对 HasBuffet div 执行向下滑动功能。创建此内容的最佳方法是什么,请记住页面上有几个类似的部分,我希望根据单选列表中的是或否的答案来揭示问题。

最佳答案

检索RadioButtonList1的选中值的简单方法是:

$('#RadioButtonList1 input:checked').val()

蒂姆编辑:

其中 RadioButtonList1 必须是 RadioButtonList 的 ClientID

var rblSelectedValue = $("#<%= RadioButtonList1.ClientID %> input:checked"); 

关于jquery - 从 asp :RadioButtonList using jQuery 读取所选值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/308301/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com