IE7: Empty form when file input disabled

2009-02-06

Here's another problem in IE7 that'll break your head if you're not carefull. And this time, it seems like it has nothing to do with keep alive...

Somehow the form in my current project refuses to be posted when I disable a file input onsubmit. When I set the onsubmit (either inline or externally by JS) the form submits nothing. When I remove the line that disables the input, everything is fine.

When I try to repro this on just the form, the bug does not appear. So it is most likely something else in combination with disabling the input is causing this problem. At this point the application is too big for me to try and narrow it down. But maybe I'll do it later because this is a weird one and I'm curious.

So, if you're getting empty POST data when submitting a form in IE7 and you're disabling a file input; don't.

Hope it helps you.