Pressing Return Submits a Form in IE

Results 1 to 3 of 3

Thread: Pressing Return Submits a Form in IE

  1. #1
    Join Date
    Dec 1969

    Default Pressing Return Submits a Form in IE

    (Hopefully this is the right forum to ask this question..<BR>if not, maybe someone can tell me which one to post it in?)<BR><BR>The Default behaviour in Internet Explorer is to submit (or POST) your form when you press the "Enter" or "Return" keys from an Input Box that is within that Form.<BR>I want to try and find out.. how, in your HTML code, do you stop this from happening? i.e. when the user presses Return.. I don&#039;t want anything to happen.<BR>I&#039;m designing a new system for Mainframe users - they&#039;re used to pressing Return to "Tab" to the next field.. so having teh form submit is going to cause all sorts of problems.<BR><BR>It&#039;s difficult to search for answers to thsi problem on teh web as the words "enter" and "return" are used for so many things.<BR>Anyone have any ideas?<BR><BR>Dourn.

  2. #2
    Join Date
    Dec 1969

    Default I've found that if I ..

    .. don&#039;t use a submit button/image and instead, have a link that submits the form -- It works how you want.<BR><BR>&#060;a href="javascript: document.formname.submit();"&#062;Submit&#060;/a&#062;<BR><BR>You may want to use a graphic instead of the text (or even make a graphic that looks like the std. submit button).

  3. #3
    Join Date
    Dec 1969

    Default RE: Pressing Return Submits a Form in IE

    I&#039;m sure I&#039;ve seen someone ask a very similar question quite a while ago on the message board. Anyway, the way to stop it is to replace your submit buttons with:<BR><BR>&#060;input type="button" value="Submit" onclick="this.form.submit()"&#062;<BR><BR>If you wanted to get the return key to act like a tab have a look at:<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts