第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如果 radiobtnlist 的值為 1,我想啟用文本框

如果 radiobtnlist 的值為 1,我想啟用文本框

九州編程 2021-11-25 19:34:13
如果 RadioButtonList 的值為零,我有這個代碼來禁用文本框。但它不起作用我不知道為什么。<script type="text/javascript">     $(function () {            $("#RadioButtonList1").change(function() {              var st = ("#RadioButtonList1").val();              if (("#RadioButtonList1").val() == "1") {                   $("#TextBox_ArrivalDate").prop("disabled",false);              }else{                  $("#TextBox_ArrivalDate").prop("disabled",true);              }            );       });</script>這是我的 RadioButtonList<asp:Label ID="type" Cssclass="label" runat="server" Text="Please Choose One"></asp:Label><asp:RadioButtonList ID="RadioButtonList1" runat="server" style="margin-left: 47px" Width="153px">    <asp:ListItem Value="1">Round Trip</asp:ListItem>    <asp:ListItem Value="0">One Way</asp:ListItem></asp:RadioButtonList>
查看完整描述

3 回答

?
夢里花落0921

TA貢獻(xiàn)1772條經(jīng)驗 獲得超6個贊

 $(document).ready(function () {

                $('#RadioButtonList1 input').change(function () {

                    debugger;

                    if ($(this).val() == 1) {

                        $('#TextBox_ArrivalDate').attr("enabled", "enabled");

                    } else {

                        $('#TextBox_ArrivalDate').attr("disabled", "disabled");

                    }

                });

            });


查看完整回答
反對 回復(fù) 2021-11-25
?
狐的傳說

TA貢獻(xiàn)1804條經(jīng)驗 獲得超3個贊

希望我的片段可以在任何方面幫助你。祝你今天過得愉快!


<html>


<head>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

  <script type="text/javascript">

    $(function() {

      $("[name=trip]").change(function() {

        var st = $("[name=trip]:checked").val();

        if (st == "1") {

          $("#TextBox_ArrivalDate").prop('disabled', false);

        } else {

          $("#TextBox_ArrivalDate").prop('disabled', true);

        }

      });

    })

  </script>

</head>


<body>

  <input type="radio" name="trip" value="1" checked> roundtrip<br>

  <input type="radio" name="trip" value="0"> one way<br>

  <input type="text" id="TextBox_ArrivalDate">

</body>


</html>


查看完整回答
反對 回復(fù) 2021-11-25
?
胡說叔叔

TA貢獻(xiàn)1804條經(jīng)驗 獲得超8個贊

改變這一行


$("#RadioButtonList1").change(function() 到 $("<%= RadioButtonList1.ClientID %>").change(function()。


ASP.Net 以不同的格式呈現(xiàn) RadioButton ID。您可以使用此語法在客戶端訪問單選按鈕的 id。


查看完整回答
反對 回復(fù) 2021-11-25
  • 3 回答
  • 0 關(guān)注
  • 171 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號