KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Making the Enter Key submit an HTML form
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: June 2, 2000

On many popular web sites such as Yahoo!, MetaCrawler and 4D you will notice that after typing some text into the search field, simply pressing Return or Enter will cause the underlying HTML form to be submitted without having to click on a Submit button with the mouse. There is no trick to making this happen, it is automatic as long as there is only a single text field on the HTML form. If you wish to enable this behaviour on an HTML form with multiple text entry areas, you will have to write JavaScript that calls Submit() when the user types the Enter key.