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.

CommentFileSizeAuthor
form_submit.js_.txt1.75 KBElectronick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wretched sinner - saved by grace’s picture

Status: Needs review » Active

#376425: Automatic supply for enter-key submit of forms with ahah was double post - set as duplicate.

No patch attached - maybe forgot?

wretched sinner - saved by grace’s picture

Version: 6.x-dev » 7.x-dev
Status: Active » Needs review

OK - just saw #376393: Not seeing attached files - maybe try reposting patch?

Also, features go to HEAD, not current

cburschka’s picture

Title: Automatic supply for enter-key submit of forms with ahah » Submit AHAH forms when Enter is pressed in field.
Status: Needs review » Needs work

1.) 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().