@zdziebloauthorJan 08.2009 — #found the problem.. if <input type="submit"> isn't surrounded by <form></form> tags, IE focuses on the first found <input type="submit"> element... guess gonna have to use <button> instead.
@slaughtersJan 08.2009 — #I think that focus is given to submit buttons by default in IE, even when wrapped in a form. I've had to use type=image and type=button to get around that issue in the past.
@toicontienJan 08.2009 — #The submit button doesn't receive focus. Browsers highlight the submit button in a form that gets "clicked" automatically when you press ENTER in a text field for instance, when the form is submitted by a user action other than clicking the submit button. It's a visual way of telling the user what the form's default action is.
Consider that you have a RESET and SUBMIT button in your source code, in that order. Pressing ENTER on a text field in the form causes the browser to automatically "click" the RESET button -- which is why the browser highlights which submit button is used to submit the form. ? This is also why pressing ENTER on a form field does not submit the form unless there is a SUBMIT, RESET, or IMAGE button inside the form.
@toicontienJan 09.2009 — #Ah. Right you are, TheTeenScripter. It's good to note, however, that if you have more than one SUBMIT or IMAGE type button on your form, it then uses the first SUBMIT or IMAGE button it encounters. [code=html]<form action="#" method="get"> <input type="text" value=""> <input type="image" name="action" value="Cancel" src="btn_cancel.gif"> <input type="submit" name="action" value="Delete"> <input type="submit" name="action" value="Save"> </form>[/code] In this example, the "default" button is the IMAGE button.
@toicontienJun 08.2009 — #This "issue" (behavior, rather) happens regardless of whether you use tables or CSS for layout. The browser simply uses the first submit, reset or image button it encounters in the form source code as the default submit button for the form.