I have two asp combobox one with the name of cmb_stocktype while second with the name of cmb_tagno. Now, my question is that when I select cmb_stocktype with the value of WithStock then cmb_tagno should be show else it should be hide by javascript.
Here is my following code,
<asp:DropDownList CssClass="form-control" id="cmb_stocktype" runat="server">
<asp:ListItem Value="WithStock">WITH STOCK</asp:ListItem>
<asp:ListItem Value="WithoutStock">WITHOUT STOCK</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="cmb_tagno" runat="server" Style="width:90%;" CssClass="form-control" ClientIDMode="Static" ></asp:DropDownList>
$("#<%= cmb_stocktype.ClientID %>").change(function () {
if ($("#<%= cmb_stocktype.ClientID %>").val() == "WithStock") {
$("#<%=cmb_tagno.ClientID%>").show()
}
else {
$("#<%=cmb_tagno.ClientID%>").hide()
}
});
I used style.display and style.visibility still didn’t work.