title: How to RESPOND to a click event on an input type=file in non IE browsers
body: <p>So here's the scenario-</p>
  
  <p>Unlike the 3000 other questions on StackOverflow about how to INVOKE the click event on an input[type=file] element, I just want to respond to it. I'm looking for something like:</p>
  
  <pre><code>&lt;input id="theFile" onclick="var that=this;setTimeout(function(){if(that.value){postTheForm();}}),0);" /&gt;
  </code></pre>
  
  <p>I'm not trying to call click() on the element, I just want to know when someone has selected a file so it we can submit the form. In IE, it works as expected, because the file dialog box sleeps the javascript thread until the user clicks Open or Cancel in the dialog. In FireFox, it seems like the dialog does not sleep the thread, and the anonymous function fires immediately - even while the dialog is still up.</p>
  
  <p>I was thinking may I could use the onchange event, or something else in FireFox to simulate the IE behavior, but haven't had any luck so far. Any ideas as to how I can execute code AFTER the user clicks Open or Cancel in the dialog?</p>