title: jq-idealforms Send Form Via AJAX
body: <p>I have a simple login form.</p>
  
  <pre><code>&lt;form id="login" action="process/login_process.php" method="POST" name="login" accept-charset="utf-8"&gt;
  &lt;div&gt;&lt;label&gt;Username:&lt;/label&gt;&lt;input type="text" name="username" data-ideal="required"/&gt;&lt;/div&gt;
  &lt;div&gt;&lt;label&gt;Password:&lt;/label&gt;&lt;input type="password" name="password" data-ideal="required"/&gt;&lt;/div&gt;
  &lt;div&gt;&lt;button id="submit" type="submit"&gt;Login&lt;/button&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I'm using JQ-IDEALFORMS for the validation and overall prettiness of the form. I'm having the hardest time figuring out how to submit the form via ajax. This is the javascript I have so far:</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/ui/1.9.0/jquery-ui.min.js"&gt;&lt;/script&gt;
  &lt;script src="javascripts/jquery.idealforms.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      var options = {
          onSuccess: function() {
              $.post('process/login_process.php', $myform.serialize())
              alert(responseXML);
          }
      };
      var $myform = $('#login').idealforms(options).data('idealforms');
      $('#submit').click(function() {
          $.post('process/login_process.php', $myform.serialize());
          alert('hello');
      });
  </code></pre>
  
  <p>I followed the very limited directions in their documentation and added the $.post to the onSuccess action in the options variable. That doesn't work. I then tried to add a listener to the submit button and the alert box never comes up, meaning that listener is never triggering. How should this be done? I've been able to submit the form, but when I do, it redirects the page to my php page where my XML is being echo'd. For some reason, I can't get it to echo back to my login page.</p>