Users are mistakenly pressing the enter/return key when filling in webform which causes form to submit.
Looking for snippet to disable enter/return key so that form does not submit until user clicks on "submit" button.
Thanks
Users are mistakenly pressing the enter/return key when filling in webform which causes form to submit.
Looking for snippet to disable enter/return key so that form does not submit until user clicks on "submit" button.
Thanks
Comments
Comment #1
quicksketchUse this bit of jQuery. Done correctly, you should theme the form and add the javascript to the page through theming (follow the instructions in THEMING.txt and just add the javascript to the new template file).
For a quick hack you can make the Description Full HTML and put in the code directly.
The jquery.js file must already be added to the page for this to function properly.
Comment #2
quicksketchOops, changed the title.
Also, because this isn't a Webform request, I'd suggest learning jQuery from one of these fine sources:
http://visualjquery.com
http://docs.jquery.com/How_jQuery_Works
Comment #3
quicksketchComment #4
AimAdvantage commentedInstead of installing or depending on an external .js file- this solution was much lighter and easier for me-
I found this one to work fairly easily by creating a full html block and entering these few lines of code:
Hope this is a simpler solution.
Aaron
http://www.aimadvantage.com/