title: jQuery: function not working when clicking button inside <form runat="server">
body: <p>With jQuery, in (document).ready I assigned a click function to all buttons of my asp.net (aspx) page.
  When I click a button outside , the function works properly.
  When clicking a button INSIDE the form, it doesn't work. Why?</p>
  
  <p>Here my default.aspx page:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="jQuery._Default" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script type="text/javascript" src="Scripts/jquery-1.4.1.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  
          $(document).ready(function () {
              $("button").click(function () {
                  $("input").before("ciao");
              });   
          });
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;button id="Button1"&gt;Button BEFORE Form&lt;/button&gt;
  &lt;button id="Button2"&gt;Another BEFORE Form&lt;/button&gt;
  
      &lt;form id="form1" runat="server"&gt;
  
  
      &lt;button id="btStart"&gt;Button in Form&lt;/button&gt;
      &lt;div&gt;
      &lt;input type="text" value="I like number 1" /&gt;
      &lt;input type="text" value="Smile to number 2" /&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm using Visual Studio 2010. I tried also with jQuery 1.4.2, same problem.</p>
  
  <p>Thanks for letting me know, cheers.</p>