title: Hashing a password before form submission in IE9
body: <p>I have implemented the example given in this article for one of my websites: 
  <a href="http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL" rel="nofollow">http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL</a></p>
  
  <p>All was well until IE9 users started reporting that they could not log in to the site. Users HAVE javascript enabled but I still could not work out why this was happening. The same users can log in using other browsers, so it's not a case of forgotten password either (which I very much suspected!)</p>
  
  <p>The formhash function was written exactly as it appeared in the article (very annoying copying it from an image!)</p>
  
  <pre><code>function formhash(form, password) {
    console.log("Hashing form");
    // Create a new element input, this will be our hashed password field.
    var p = document.createElement("input");
    // Add the new element to our form.
    form.appendChild(p);
    p.name = "p";
    p.type = "hidden"
    p.value = hex_sha512(password.value);
    // Make sure the plaintext password doesn't get sent.
    password.value = "";
    // Finally submit the form.
    form.submit();
  }
  </code></pre>
  
  <p>No errors are reported upon submission, so it doesn't appear to be anything not being supported by IE9. So what's going wrong with this hashing function? </p>