I have created a handler for every submit request using $form['#submit'][] = 'MYMODULE_form_submit_handler' now the problem is this doesnt works on Ajax submit, or page call backs functions. i want to log everything that is happening on every insert,update/delete in admin area

$form['button'] = array(
    '#type' => 'button',
    '#value' => t('Save'),
    '#attributes' => array(
        'onclick' => 'return false;',
        'class' => array('form-submit', 'rights-form-submit')

Where 'rights-form-submit' is a class that directs this button to AJAX call from javascript. i want to call hook on success / failure of request

1 Answer 1


Setting a form element to type button prevents submit handlers from being executed. You'll need to change the type to submit if you want your submit handlers to be called.

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.