title: Open file input dialog and upload onchange possible in IE?
body: <p>This is basically and simplified what I have now:</p>
  
  <pre><code>&lt;style&gt;
  form.noshow { height: 0; overflow: hidden; }
  &lt;/style&gt;
  
  &lt;form class=noshow target="SomeIframeThatExists"&gt;
    &lt;input type=file id=uf&gt;
  &lt;/form&gt;
  
  &lt;a id=uflink href="/user/photo"&gt;Upload photo&lt;/a&gt;
  
  &lt;script&gt;
  $('uf').addEvent('change', function(e) {
    // alert('oele'); // this would work fine
    this.form.submit(); // auch in IE &gt; "Access denied" exception
  });
  $('uflink').addEvent('click', function(e) {
    $('uf').click(); // opens file dialog in all browsers inc IE
    return false;
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>What it does (perfectly) in Chrome 11 and FF 4:</p>
  
  <ol>
  <li>The form is hidden.</li>
  <li>You click the link</li>
  <li>Choose file dialog opens</li>
  <li>You select a file</li>
  <li>Dialog closes</li>
  <li>Form is submitted</li>
  <li>Script in iframe is executed and photo is replaced</li>
  </ol>
  
  <p>Very hightechlike and sweet.</p>
  
  <p>In IE, all of that works, except [6]. The form isn't submitted. Javascript error: "Access denied". Doesn't matter how the form is invisible, as long as the dialog was opened with <code>input.click()</code> the form can't be submitted on change. (The onchange function is executed fine. The error only occurs when <code>form.submit()</code> is called.)</p>
  
  <p>Now all of this I can accept. IE sucks. I live with it.</p>
  
  <p>My solution so far was to check the <code>navigator</code> for "MSIE" and then when clicking the link instead of opening the dialog, showing the form (with the file input). Then the user has to click the actual, ugly file input and then everything works fine. But ugly.</p>
  
  <p>The question is twofold:</p>
  
  <ol>
  <li>Is there a way to do this in IE as cool as it is in Chrome? WITHOUT nasty flash/java crap. Only html elements andjavascript.</li>
  <li>If not: is there a way to check for form.submit() support after opening the dialog from a link (besides <code>!navigator.contains("MSIE")</code>)?</li>
  </ol>
  
  <p>[2] could be catching the "Access denied" exception thrown in IE, but then it's too late: the user has already opened the dialog and browsed to the photo. You don't wanna make him do that again. (Even IE users don't deserve that.)</p>
  
  <p>PS. I'm only interested in Chrome 10+, Firefox 3.6+ and IE8+.</p>
  
  <p><strong>PS. Might be important:</strong> the file input element can't be anywhere near the link, because the link is inside a form and that form is (must be) separate from the file upload form.</p>
  
  <p><strong>UPDATE</strong><br>
  Second best: detect support for this high-techlike behaviour that only doesn't work in IE.   I don't wanna use <code>navigator.appName.contains('MSIE')</code> because that's not flexible and not necessarily true.</p>