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.
By qqboy on
in function ajax_pre_render_element, I found this part difficult to understand,
// 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.
if (!isset($element ['#ajax']['prevent'])) {
$element ['#ajax']['prevent'] = 'click';
}
can some one help us make it clear.
what is it about, which means that click can not trigger ajax ?
thanks very much.
Comments
Stated a different way
What it's saying is that only the ajax action will be triggered.
If you're handling a form with ajax, you don't want the form to also submit normally. That's what this helps with.
sorry can not understand
sorry can not understand sorry
https://www.drupal.org/project/image_captcha_indicator
https://www.drupal.org/project/ext_js