One of the available admin settings is the trigger options. You can choose either of:

  • Trigger when button is clicked
  • Trigger when button is clicked or when ENTER key pressed

However, even if you choose the first option, the code for the ENTER key will continue to run.

Worse, this piece of code doesn't even limit the keypress to the ENTER key — any key you hit will submit the form. For example, if you are using the TAB key to move between form elements and you tab over a submit button, then *poof* the form submits itself.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kevin.dutra’s picture

Status: Active » Needs review
FileSize
1.58 KB

Here's a patch that fixes both issues, as well as cleans up a couple minor things in the JS file.

kevin.dutra’s picture

Whoops, missed a couple things.

greggles’s picture

Status: Needs review » Closed (outdated)

Thanks for submitting this issue.

The 6.x branch of this module is not supported. This issue was filed against the 6.x version so I'm closing it because it doesn't seem relevant to the 7.x version.

If the issue is relevant for the 7.x version: I apologize for closing it. Can you please reopen it and adjust the version number?