Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用jQuery在回发期间更改单选按钮所选项目文本_Jquery_Asp.net_Asp.net Ajax_Updatepanel - Fatal编程技术网

使用jQuery在回发期间更改单选按钮所选项目文本

使用jQuery在回发期间更改单选按钮所选项目文本,jquery,asp.net,asp.net-ajax,updatepanel,Jquery,Asp.net,Asp.net Ajax,Updatepanel,我在更新面板中有一个单选按钮列表,如下所示: <asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="233px" ClientIDMode="Static" AutoPostBack="true" onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">

我在
更新面板中有一个单选按钮列表,如下所示:

<asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="233px" 
                ClientIDMode="Static" AutoPostBack="true" 
                onselectedindexchanged="RadioButtonList1_SelectedIndexChanged">
                <asp:ListItem Value="1">1</asp:ListItem>
                <asp:ListItem Value="2">2</asp:ListItem>
                <asp:ListItem Value="3">3</asp:ListItem>
                <asp:ListItem Value="4">4</asp:ListItem>
            </asp:RadioButtonList>
但它不起作用。我的错在哪里


谢谢

省去函数调用,只需在javascript代码块中包含以下内容:

$(document).ready(function () {
    $('#RadioButtonList1').on("change", function () {
        $("#RadioButtonList1 input:checked").val("Please Wait...");
    });

}))

您应该更改此代码:

$("#RadioButtonList1 input:checked").val("Please Wait...");

to

$("#RadioButtonList1 input:checked").parent().find('label').text("Please Wait");
尝试:

函数pageLoad(){
$(文档).ready(函数(){
$('#')。关于(“更改”,函数(){
$(“#”).find(“输入[检查]”).val(“请稍候…”);
});
});
}

单选
按钮值不显示在浏览器视口中,您应该使用
标签
并更改其文本:

   $(document).ready(function () {
            $('#RadioButtonList1').on("change", function () {
                $("#RadioButtonList1 input:checked").closest("label").text("Please Wait...");
            });
       });

请记住检查readiobuttonList的ID是否正确,因为当服务器控件呈现时,ID会发生变化。
function pageLoad() {
        $(document).ready(function () {
            $('#<%=RadioButtonList1.ClientID %>').on("change", function () {
               $("#<%=RadioButtonList1.ClientID %>").find("input[checked]").val("Please Wait...");
            });
       });
    }
   $(document).ready(function () {
            $('#RadioButtonList1').on("change", function () {
                $("#RadioButtonList1 input:checked").closest("label").text("Please Wait...");
            });
       });