Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This behavior provides ahah submit on a Enter-press form submit. For multisubmit form it searches for submit element has class "default-submit" and if that one, submits it.
Comment | File | Size | Author |
---|---|---|---|
form_submit.js_.txt | 1.75 KB | Electronick |
Comments
Comment #1
wretched sinner - saved by grace CreditAttribution: wretched sinner - saved by grace commented#376425: Automatic supply for enter-key submit of forms with ahah was double post - set as duplicate.
No patch attached - maybe forgot?
Comment #2
wretched sinner - saved by grace CreditAttribution: wretched sinner - saved by grace commentedOK - just saw #376393: Not seeing attached files - maybe try reposting patch?
Also, features go to HEAD, not current
Comment #3
cburschka1.) Please read the coding standards for JS files as well as some Javascript files already included in core. It needs to be properly indented for one thing.
2.) There are debug alert() calls in the code. Needless to say, these need to come out before the patch can move forward.
3.) I read this code several times and am foggy on what exactly each line is doing. More inline comments and explanatory variable names would be a good idea. By the way, I don't think you need to initialize a variable as null in JS, since "var variable;" will automatically set it to null. I may be wrong on that last point, though.
4.) In order to actually load the Javascript file on pages, it has to be added somewhere in PHP with drupal_add_js().