Monday, 11 January 2016
Show or Hide a Image/Button DropDownList change using Jquery in ASP.NET
Here I will explain about show or hide image,modalpopup,buttons,tables..etc on DropDownlist change using jquery. I use jquery change() method to show or hide an image,modalpopup,tables..etc.It will be working based on dropdownlist value.
ASP.NET
<asp:DropDownList ID="ddlType" runat="server">
<asp:ListItem Text="Select" Value="0"></asp:ListItem>
<asp:ListItem Text="Show" Value="S"></asp:ListItem>
<asp:ListItem Text="Hide" Value="H"></asp:ListItem>
</asp:DropDownList>
<asp:Button ID="btnShow" runat="server" Text="Show/Hide"/>
jQuery
$(document).ready(function () {BredCrumb();
$("[id*=ddlType]").change(function () {
var value = $("[id*=ddlType] option:selected").val();
alert(value);
if (value == "H")
$("[id*=btnShow]").hide();
else if (value == "S")
$("[id*=btnShow]").show();
});
});
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment