Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to disable 'Enter' key

Featured Replies

I have a form which the user fills out on the web, but whenever they press the 'Enter' or 'Return' key it executes the "Submit" action (which actually edits a record in the database.) I really only want the form submitted by clicking the "Submit" button.

Is there any way of disabling the 'enter' key from executing the submit action?

Couple of options, check them out see if any work for you...

add this javascript:

<script language="JavaScript">

function disableEnterKey()

{

if (window.event.keyCode == 13) window.event.keyCode = 0;

}

</script>

then add onKeyPress="disableEnterKey()" to your form tag

like so:

<FORM NAME="QTY" ACTION=FMPro METHOD=post onKeyPress="disableEnterKey()">

http://www.dynamicdrive.com/dynamicindex16/disableenter.htm

http://forums.devshed.com/archive/1/2001/10/4/24642

http://developer.irt.org/script/2066.htm

Since you're looking for a form solution rather that a filemaker solution, there is quite a bit of info out there. Just use google and search for it. Thats what I did to find those links. Hope you can find one of them to be useful!

Note: this is in response to Pedro

On behalf of the Psychic Procrastinators I sense that you are using IWP (Intuitive Web Publishing). The links provided by IrongateMachine are very interesting, but how are you going to insert the JavaScript into a form which is generated "on the fly"?

re: Is there any way ...

Ya, sure. It's called CWP.

Have a happy Thanksgiving, then get to work.

You can also take control of what happens whenever the "Enter Key" is pressed, when a Form has Focus. This can be done by the use of Javascript functions and the "onsubmit=" parameter of the <form> tag.

All the best.

Garry

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.