Do not submit form on "enter"

Results 1 to 2 of 2

Thread: Do not submit form on "enter"

  1. #1
    Join Date
    Dec 1969

    Default Do not submit form on "enter"

    I have a form with many entry fields. I do not want the form to be submitted if the user click the enter button on their keyboard. I want them to have to scroll down and click the "Submit" button on the form.<BR><BR>Is there any way to do this?

  2. #2
    Join Date
    Dec 1969

    Default RE: Do not submit form on

    function KeyPress() {<BR> if (window.event.keyCode == 13){<BR> document.form.Hidden.value=&#039;update&#039;;<BR> //document.form.submit();<BR> }<BR>}<BR><BR>if (navigator.appName == &#039;Netscape&#039;) {<BR> window.captureEvents(Event.KEYPRESS);<BR> window.onKeyPress = netscapeKeyPress;<BR>}<BR><BR>function netscapeKeyPress(e) {<BR> if (e.which == 13){<BR> document.form.Hidden.value=&#039;update&#039;;<BR> //document.form.submit();<BR> }<BR>}<BR><BR><BR>&#060;BODY onKeyPress="KeyPress()"&#062;<BR><BR>I use this submitting in N & IE, but I guess since I commented out the submit nothing will happen.<BR><BR>It may just work.

Posting Permissions

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