I have found some strange behaviour of form ajax elements.

I have added #ajax to my form elements:

['#ajax'] = array(    
  'callback' => 'mymodule_ajax_callback',
  'event' => 'change',
  'progress' => array('type' => 'none'),                         

and due to some other issues, i had to add ajax to my submit:

$form['actions']['submit']['#ajax'] = array(
  'callback' => 'mymodule_node_form_submit',

The issue is, when the form element ajax is triggered for "checkboxes" and "select" form field type at the same time, then submit callback is triggered but i never clicked submit.

Does anybody have any idea?

1 Answer 1


There is a quirk in the AJAX form api which causes the last button on the form to be submitted under certain circumstances. Without seeing all of your code, it would be difficult to isolate the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.