Pedro Filipowsky Posted November 26, 2003 Posted November 26, 2003 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?
IrongateMachine Posted November 26, 2003 Posted November 26, 2003 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!
Unable Posted November 26, 2003 Posted November 26, 2003 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.
Garry Claridge Posted November 26, 2003 Posted November 26, 2003 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
Recommended Posts
This topic is 7737 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now