Change record status: 
Project: 
Introduced in branch: 
7.x
Introduced in version: 
7.6
Description: 

A new #ajax['prevent'] property was added, defaulting to 'click'.

Binding to 'mousedown' rather than 'click' means that it is possible to trigger a click by:

  1. Pressing the mouse button
  2. Holding the mouse button down until the Ajax request is complete and the button is re-enabled.
  3. Then releasing the mouse button.

Setting the 'prevent' property makes ajax.js bind an additional handler to prevent such a click from triggering a non-Ajax form submission. This also prevents a textfield's <Enter> keypress from triggering this button's non-Ajax form submission behavior.

See:

#ajax on Forms API reference

Ajax Framework

Impacts: 
Module developers
Themers