Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE11-Only Submit Bug

I have a form on a page, something simple like:

<form action="form/submit" method="post">
    <button type="submit">Submit</button>
</form>

It works in every single browser, including older versions of IE, BUT in IE11 it fails, with the tab stuck in a continuous loading loop, never changing to the "thank you" page after submission. HOWEVER, if I open the console, it DOES work.

I'm aware of the console.log issues IE has, and already am using:

if (!window.console) {
    console = {
        log: function() {}
    };
}

to avoid it, which seems to be doing fine (as mentioned, every other IE works). Any insight as to where the issue might lie?

like image 570
Brian Avatar asked Nov 22 '13 16:11

Brian


3 Answers

The problem appears when a form only has input elements without a name attribute (or no input elements). I found a reference to the bug here, though it also happens in desktop mode and not just metro mode as the link claims:

http://connect.microsoft.com/IE/feedback/details/807447/ie-11-metro-version-submitting-form-fails-if-input-tag-has-no-name-attribute

The fix is to create a dummy <input type="hidden" name="dummy" value="something"> field (with a name and value set) before submitting the form.

The bug happens in all compatibility modes offered by IE11.

like image 151
pilif Avatar answered Sep 22 '22 19:09

pilif


I just spent WAY too much time on this bug. The crazy part is, IE11 allow the form submission if you have the dev tools (f12) open. This is what I put before my submit button:

<input type="hidden" name="ie11sux" id="ie11sux" value="<?php echo md5(microtime()."ie11sux"); ?>"/> 
like image 33
punkbyte Avatar answered Sep 24 '22 19:09

punkbyte


It's a bug in IE11. You can fix it if you add a name attribute to the button, like:

<button type="submit" name="foo" ...
like image 24
Alex Baban Avatar answered Sep 22 '22 19:09

Alex Baban