title: Problem submitting form on window.unload
body: <p>I am having a problem submitting form on window unload if form information has been updated (album.updated = true):</p>
  
  <pre>
  window.onunload = function(evnt) {
    if (album.updated) {
      var save = confirm('Do you want to save changes?');
      if (save) {
        alert('submitting form...');
        document.edit_photos.submit();
      }
    }
  }
  </pre>
  
  <p>It alerts "submitting form" but nothing is saved. But when I do a regular submit with a Save button - it saves information. What could be wrong here?</p>