title: show div on form submit with no redirect
body: <p>I'm using a WordPress sidebar widget to capture email addresses. The thing is, it redirects after form submission. I want the visitor to stay on the page they were on after form submission with just a hidden div giving a successful signup message.</p>
  
  <p>I've tried something with javascript like this --</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function showHide() {    
  var div = document.getElementById("hidden_div");
  if (div.style.display == 'none') {
  div.style.display = '';
  }
  else {      
  div.style.display = 'none';
  }
  } 
  &lt;/script&gt;
  </code></pre>
  
  <p>And that works perfectly for showing the hidden div on submit, but the actual form then doesn't work :(</p>
  
  <p>The form (with what I was trying to do) is like this --</p>
  
  <pre><code>&lt;div id="wp_email_capture"&gt;&lt;form name="wp_email_capture" method="post" onsubmit="showHide(); return false;" action="&lt;?php echo $url; ?&gt;"&gt;
  &lt;label class="wp-email-capture-name"&gt;Name:&lt;/label&gt; &lt;input name="wp-email-capture-name" type="text" class="wp-email-capture-name"&gt;&lt;br/&gt;
  &lt;label class="wp-email-capture-email"&gt;Email:&lt;/label&gt; &lt;input name="wp-email-capture-email" type="text" class="wp-email-capture-email"&gt;&lt;br/&gt;
  &lt;input type="hidden" name="wp_capture_action" value="1"&gt;
  &lt;input name="submit" type="submit" value="Submit" class="wp-email-capture-submit"&gt;
  &lt;/form&gt;
  
  &lt;div id="hidden_div" style="display:none"&gt;&lt;p&gt;Form successfully submitted.&lt;/p&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>The problem is coming in somewhere between 'return false' and the form action (which is where the plugin's coder has made it redirect I think). If I remove 'return false', it redirects. With 'return false' there, the form doesn't work. I can't figure out a way to get the form to work but not redirect, ie. just show the hidden div, work, and that's it! No redirect :) Would appreciate your help.</p>