How to omit form's validation at AJAX button click?
You can use the #limit_validation_errors property:


  Provides an array of sections which are parts of $form_state['values'] which should be validated, implying that sections which are not listed should not be validated. This is normally used in multistep forms in the case of a "back" button, for example, where '#limit_validation_errors' => array() would mean not to validate anything as form values on the current page are to be discarded anyway. #limit_validation_errors does not have any effect if #submit is not set. More discussion is in the form_set_error() documentation.


e.g.

'ajax_button' =&gt; array(
    '#type' =&gt; 'button',
    '#value' =&gt; t("Scan for tags"),
    '#ajax' =&gt; array(
      'callback' =&gt; 'ajax_tag',
      'wrapper' =&gt; 'dynamic-tags-fieldset',
      'method' =&gt; 'replace',
      'event' =&gt; 'click',
      'prevent' =&gt; 'submit click mousedown',
    ),
    '#limit_validation_errors' =&gt; array(), // No elements will be validated
    '#submit' =&gt; array('custom_function'), // An explicit submit functions array is required for this, but may be empty
  ),


However, each validation function is free to respect '#limit_validation_errors' or not. If you want your validation functions to respect this parameter, you need to:


Obtain #limit_validation_errors value from clicked button using $form_state['clicked_button']['#limit_validation_errors']
Pass it as a third argument to each form_set_error() call