title: Submitting from an ajax loaded form
body: <p>H_i</p>
  
  <p>Have anybody ideas for submitting ajax loaded form:
  www.example.com/form.php is</p>
  
  <pre><code>&lt;form&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;Your name?&lt;/legend&gt;
          &lt;input type="name" id="name" /&gt;
          &lt;button type="submit"&gt;OK!&lt;/button&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and www.example.com/index.php is</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;Myform&lt;/title&gt;
          &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="formDiv"&gt;&lt;/div&gt;
          &lt;button id="open"&gt;Open&lt;/button&gt;
          &lt;button id="close"&gt;Close&lt;/button&gt;
          &lt;script type="text/javascript"&gt;
              (function($) {
                  $(document).ready(function() {
                      $('#open').click(function() {
                          $('#formDiv').load('www.example.com/form.php');
                      });
                      $('#close').click(function() {
                          $('#formDiv').empty();
                      });
                      $('#formDiv form').submit(function() {
                          alert("Hello, "+($('#formDiv form #name').val())+"!");
                          return false;
                      });
                  });
              })(jQuery);
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I want that alerts an "Hello, myname" instead of a submit.</p>
  
  <p>Thank you</p>