title: IE Follows Link Even After onclick="return false;"
body: <p>I'm writing a Rails 2.3.8 app, and using the standard <code>link_to</code> helper.  I have a reasonable number of links that user methods other than GET, so I pass a <code>:method =&gt; :whatever</code> option to <code>link_to</code>, and it generates a link with an onclick handler like so (indentation added for readability):</p>
  
  <pre><code>&lt;a
    onclick="
      var f = document.createElement('form');
      f.style.display = 'none';
      this.parentNode.appendChild(f);
      f.method = 'POST';
      f.action = this.href;
      var s = document.createElement('input');
      s.setAttribute('type', 'hidden');
      s.setAttribute('name', 'authenticity_token');
      s.setAttribute('value', '31M3q8SJkRz7f0R80l42Z2W7O2N7ZrzufhWQYql/Zd8=');
      f.appendChild(s);
      f.submit();
      return false;"
    href="/transactions/1015/transcribe"
  &gt;
  Enter Data
  &lt;/a&gt;
  </code></pre>
  
  <p>Now, for whatever reason, IE (both 7 &amp; 8 - the two I've tested) has decided that the <code>return false;</code> at the end there isn't enough to stop it from following the link, and I end up getting two requests to my server:  The POST request from the onclick handler, which I want, and the GET request from the link itself, which I don't.  In fact, that route doesn't exist for anything other than a POST request, so when the browser follows the GET request, the user gets dumped on a 'Bad URL' error screen.  Not good.</p>
  
  <p>Has anyone seen this before, and can tell me what's causing it?  Or, better yet, does anyone know a good workaround?</p>
  
  <p><strong>PS:</strong> I'd prefer <strong>NOT</strong> to</p>
  
  <ol>
  <li>Monkey-patch <code>link-to</code>, or</li>
  <li>Write my own version of <code>link_to</code></li>
  </ol>
  
  <p>but if that's what it takes, that's what it takes.  And I'm using jQuery 1.5.something, if that helps.</p>