I have a div on my page witch is hidden : AddSupplier, I have a button on my page witch must show the div if its not visible, but the same button saves some stuff if the div is visible. So all that is working but in this AddSupplier div there is a select box "ddSupplierTypes" and when the select box gets clicked the AddSupplierButton click event gets triggered why is this, and is there a work around?
Tanks for any help.
<%@ Page Language="C#" %>
$().ready(function() { $('#AddSupplier').hide(); $('[id$=AddSupplierButton]').click(function() { if ($('#AddSupplier').is(':visible')) { //do this alert('event fired'); } else { //do that $('#AddSupplier').show(); } return false; }); }); </script> </head> <body> <form id="form1" runat="server"> <div id="wrapper"> <asp:ImageButton ID="AddSupplierButton" runat="server" Height="18px" ImageUrl="~/images/add.png" OnClientClick="return(false);"/> </div> <div id="AddSupplier"> <select id="ddSupplierTypes"> <option value="S">ss</option> <option value="F">kk</option> <option value="W">oo</option> <option value="P">ii</option> </select> </div> </form>