IE7 sometimes fails to post the submit button when pressing Return/Enter
Tuesday, March 4. 2008
For reasons not entirely obvious to me, Internet Explorer 7 will sometimes fail to post a form when the Enter key is used instead of clicking the Submit button.
In my case, I am using <INPUT TYPE="IMAGE"> instead of <INPUT TYPE="SUBMIT">. When the button is clicked, it works fine. But when one of the text controls has the focus, and the Enter key is pressed, nothing happens.
This same code works fine in Firefox.
My workaround is to put a hidden Submit button on the form, and replace the INPUT control with a image link:
<FORM NAME="default" ACTION="/search.html">
<INPUT TYPE="TEXT" NAME="search" />
<INPUT TYPE="SUBMIT" CLASS="hiddenBtn" />
<A HREF="javascript:document.forms[0].submit()">
<IMG SRC="search.gif" BORDER="0" ALT="Search">
</A>
</FORM>
Another thing to consider is that IE will not "see" the Submit button with STYLE="display:none". This thread offers the following solution:
<STYLE>
/* This is for IE */
.hiddenBtn {
width: 0px;
height: 0px;
}
/* This is for Firefox since IE ignores it */
.hiddenBtn[class] {
display: none;
}
</STYLE>
The strange thing about all of this is that it only happens sometimes, usually on more complex forms. In my case, there is a INPUT TYPE="text" form field that is built using DHTML and JavaScript. It seems that simpler forms don't have the problem.
IE7 MIME-type validation
Thursday, March 1. 2007
Internet Explorer 7.0 checks the file extension of requested resources against the mime-type of the response. If the two don't match, IE displays the ""Internet Explorer cannot download..." error message.
For example, if URL 'file.html' is requested, and in the response, the Content-type header is set to 'application/vnd.ms-excel', it will cause the error.
The fix is obvious: make sure the extension of the requested resource matches its mime-type.
LiveHTTPHeaders
Wednesday, May 31. 2006
LiveHTTPHeaders are a great way to see the HTTP headers coming down from a web server, or being sent from a web browser. It is a simple Firefox plugin. From the project:
The goal of this project is to adds information about the HTTP headers in two ways:
- First by adding a 'Headers' tab in 'View Page Info' of a web page.
- Second by adding a tool in the 'Tools->Web Development' menu to be able to display http headers in real time (while pages are being downloaded from the Internet.
- Third by letting you edit request headers and replay an URL (beta). Look for the Replay button in the live window!
This project may be of some help for the following:
- Help debugging web application.
- See which kind of web server the remote site is using.
- See the cookies sent by remote site.