New #ajax['prevent'] property added in 7.5
Last updated on
15 October 2016
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
See http://drupal.org/node/634616#comment-4681706
A new #ajax['prevent'] setting was added, defaulting to 'click'
Binding to mousedown rather than click means that it is possible to trigger a
click by pressing the mouse, holding the mouse button down until the Ajax
request is complete and the button is re-enabled, and then releasing the mouse
button. Set 'prevent' so that ajax.js binds an additional handler to prevent
such a click from triggering a non-Ajax form submission. This also prevents a
textfield's ENTER press triggering this button's non-Ajax form submission
behavior.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion