title: Greasemonkey: setting form values is not working in Firefox
body: <p>This works flawlessly under Chrome, but in Firefox the fields don't populate until the SECOND time I hit submit on the page (after it comes back from the first time telling me invalid user/pass).  What am I missing?</p>
  
  <p>This is my code for the Greasemonkey script:</p>
  
  <pre><code>document.getElementById('loginBtn').addEventListener('click',
  function (event) {
      document.getElementById('serverLogin').selectedIndex = "2";
      document.getElementById('usernameLogin').value = "username";
      document.getElementById('passwordLogin').value = "password";
      document.getElementById('loginForm').action = 'urltosubmit';
      location.href="javascript:(function(){ document.forms['loginForm'].submit(); })()";
  },true);
  </code></pre>