DropDown List 点击事件

点击下拉列表的时候遇见规定的特殊字段弹出有一个输入框:
下拉列表  <asp:DropDownList ID="ddlDocumentType" Style="width: 250px" runat="server" 
                        CausesValidation="True" onchange="DropDownClick()" AppendDataBoundItems="True">
                        <asp:ListItem>TaxInvoice</asp:ListItem>
                        <asp:ListItem>CN</asp:ListItem>
                        <asp:ListItem>DN</asp:ListItem>
  <script type ="text/javascript">

          function DropDownClick() {    
              s = $("#<%=ddlDocumentType.ClientID %>").find("option:selected").val()
              if (s == "-- Others --")        
              {
                  $('#TxtOthersDT').show();
              } else {
                  $('#TxtOthersDT').hide();
              }

          }   
      </script>
输入框:<input type=“text” id="txtOtherDT" style="display:none;" name="txtn">

 string  other=Request["txtn"];获取input页面上的值

猜你喜欢

转载自blog.csdn.net/zhaoqiong0929/article/details/80984075
今日推荐