函数dropdownlist调用的OnChange不起作用。 [英] OnChange of dropdownlist call of function not working.

查看:158
本文介绍了函数dropdownlist调用的OnChange不起作用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是下拉列表代码:

Below is Dropdownlist code:

<div class="formClmn">
                         <div class="ht49">
                             <div class="leftDv">Label Type: </div>
                             <div class="rightDv">
                                 <div class="inpBg">
                                      <div style="width: 182px">
                                         <div class="selBox">
                                             <div class="selBoxBg_search" style="width: 182px;">
                                                 <asp:DropDownList ID="select_criteria" runat="server" Width="182" onChange="disp(this.selectedIndex);"

                                                     CssClass="Tabledropdown" >
                                                <asp:ListItem>BO</asp:ListItem>
                                                <asp:ListItem>Branch</asp:ListItem>
                                                <asp:ListItem>RTA</asp:ListItem>

                                                 </asp:DropDownList>
                                             </div>
                                         </div>
                                     </div>
                                 </div>
                             </div>
                         </div>

                         </div>





以下是功能:



Below is Function:

function disp(indx) {

       alert("hii1");
       if (indx == 0) {
           document.getElementById('Client_div').style.display = "block";
           document.getElementById('Branch_div').style.display = "none";
           document.getElementById('RTA_div').style.display = "none";
       }

       else if (indx = 1) {
           document.getElementById('Client_div').style.display = "none";
           document.getElementById('Branch_div').style.display = "block";
           document.getElementById('RTA_div').style.display = "none";
       }

       else if (indx = 2) {
           document.getElementById('Client_div').style.display = "none";
           document.getElementById('Branch_div').style.display = "none";
           document.getElementById('RTA_div').style.display = "block";
       }

   }

推荐答案

< asp:listitem value =0> BO

< asp:listitem value =1> Branch

< asp:listitem value =2> RTA
<asp:listitem value="0">BO
<asp:listitem value="1">Branch
<asp:listitem value="2">RTA

这篇关于函数dropdownlist调用的OnChange不起作用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆