<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> var change = function (ddl) { var value = ddl.value; var btn = document.getElementById('btn'); var chk = document.getElementById('chk'); var lbl = document.getElementById('lbl'); var rdb = document.getElementById('rdb'); if (value == 'button') btn.style.visibility = 'hidden'; if (value == 'checkbox') chk.style.visibility = 'hidden'; if (value == 'label') lbl.style.visibility = 'hidden'; if (value == 'radiobutton') rdb.style.visibility = 'hidden'; if (value == 'All') { btn.style.visibility = 'visible'; chk.style.visibility = 'visible'; lbl.style.visibility = 'visible'; rdb.style.visibility = 'visible'; } } </script> </head> <body> <form id="form1" runat="server"> <div> visibility :: <asp:DropDownList onchange="change(this)" ID="ddl" runat="server"> <asp:ListItem Text="All" /> <asp:ListItem Text="button" /> <asp:ListItem Text="checkbox" /> <asp:ListItem Text="label" /> <asp:ListItem Text="radiobutton" /> </asp:DropDownList> <br /> <br /> <asp:CheckBox ID="chk" runat="server" Text="" /><br /> <br /> <asp:Button ID="btn" runat="server" Text="button" /><br /> <br /> <asp:Label ID="lbl" runat="server" Text="label" /><br /> <br /> <asp:RadioButton ID="rdb" runat="server" Text="" /> <br /> </div> </form> </body> </html>
function HideSearchResults() { //write your code here base on codition hide the sercer controls //eg. $('.myControl').hide(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)