Ankita Singh

Ankita Singh

  • NA
  • 159
  • 19.1k

onChange event in javascript

Feb 23 2018 10:41 PM
i wanna do that if i select value of list item in dropdown then hide some textbox and some dropdown control... i tried it but i got error that now my function hit but not got a value.... plz someone help me... i m thanking you.... plz help me ......
 
 
 
this is my scirpt function:-
<script type="text/javascript">
function ChangeText() {
debugger;
$("#course").change(function () {
alert($("#course").val());
if ($(this).val() == "B.Tech[PCB Group]") {
$('#div_graper').hide();
$('#div_yearofgra').hide();
}
});
};
my dropdown control:-
<div id="select">
<asp:DropDownList ID="course" runat="server" class="slectbig" data-bind="event" onChange="ChangeText()" >
<asp:ListItem Value="Select Course "></asp:ListItem>
<asp:ListItem Value="B.Tech[PCB Group]">B.Tech[PCB Group]</asp:ListItem>
<asp:ListItem Value="Polytechnic">Polytechnic</asp:ListItem>
<asp:ListItem Value="MBA">MBA</asp:ListItem>
<asp:ListItem Value="BBA">BBA</asp:ListItem>
<asp:ListItem Value="B.Pharma">B.Pharma</asp:ListItem>
</asp:DropDownList>
my textbox control:-
<div id="div_graper" style="width: 250px; " class="option">
<asp:TextBox ID="gradutionper" runat="server" placeholder="gradution %" ></asp:TextBox>
</div></div>
<div class="clear"></div>
</div>
 

Answers (6)