IE 8 fixes submit button bug

Sometimes when you submit a form, you may wanna disable the submit button. (e.g. When the user is posting a order / payment).

The first idea popped up in my head was like this:

 
 
 
 
<form action="http://www.google.com/search">
<input name="q" type="text" />
<input onclick="this.disabled=true; window.alert('test');" type="submit" />
</form>

Actually I was using similar code in a real life application for a client. Then he told me it can’t work. After a little test I found out that IE 7 won’t submit the form when you disable the submit button. Firefox can handle it properly though.

And as I’m messing around with IE 8, I found they fixed the bug.

To test it, go to http://playground.softboysxp.org/post_test.html , type something and hit the button. You should see a message box, then the query will be submitted to Google. While in IE7, the form won’t get submitted.

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment