4

次のコードのようなラジオボタンリストがありますupdate panel:

<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>

ユーザーがこのラジオ ボタンの任意の項目をクリックすると、ラジオ ボタンのPlease Wait...テキストではなくテキストが表示されます。次のコードを記述します。

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

しかし、それは動作しません.私の間違いはどこですか?

ありがとう

4

4 に答える 4

1

このコードを変更する必要があります:

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

to

$("#RadioButtonList1 input:checked").parent().find('label').text("Please Wait");
于 2012-04-24T12:46:15.727 に答える
1

radioボタンの値はブラウザのビューポートに表示されません。 を使用labelしてテキストを変更する必要があります。

   $(document).ready(function () {
            $('#RadioButtonList1').on("change", function () {
                $("#RadioButtonList1 input:checked").closest("label").text("Please Wait...");
            });
       });
于 2012-04-24T12:50:42.973 に答える
0

関数呼び出しを省略し、JavaScriptコードブロックにこれを含めるだけです。

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

});

于 2012-04-24T12:45:56.643 に答える
0

試す:

function pageLoad() {
        $(document).ready(function () {
            $('#<%=RadioButtonList1.ClientID %>').on("change", function () {
               $("#<%=RadioButtonList1.ClientID %>").find("input[checked]").val("Please Wait...");
            });
       });
    }
于 2012-04-24T12:49:47.713 に答える