Note that there are some explanatory texts on larger screens.

plurals
  1. POFile input gets cleared when attempted to submit on IE8
    primarykey
    data
    text
    <p>I'm working with AJAX uploads. As IE doesn't have the required object, I'll have to make a workaround with iframes.</p> <p>On theory, it's pretty simple:</p> <ol> <li>Create a form and an iframe</li> <li>Change the form's target and iframe's name attribute</li> <li>When the input file field changes, the form will be submitted</li> </ol> <p>Additionally, as the input file field sucks, it would be nice to have an "Upload" button that triggers the click event of the hidden input file field to open the file select dialog.</p> <p>Yeah, that was theory. In reality, it's way worse. First, IE8 somehow doesn't like cloned iframes, so we'll have to append each one on the go. Then, the file input field gets cleared when the submit is attempted.</p> <p>I figured out what happens and when and it's pretty ugly.</p> <p>Head to <a href="http://jsfiddle.net/uf2pJ/3/" rel="nofollow">this example</a> and it works pretty good. The form gets cloned, the file field has data and the form is submitted. However, the file input has no name attribute, and I can't access it on the server side.<br> So I added the attribute, <a href="http://jsfiddle.net/uf2pJ/4/" rel="nofollow">here's the example</a> and this is what happens: the file field is cleared. Just because the name attribute.</p> <p>It might be a dumb question, but is there a workaround with this? I'm well aware that if the file input field gets selected, it can trigger an auto upload, but I'm wondering if I can without requiring an actual click to the file field, just as in every sane browser.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload