Sometimes you have to make button that skips form field validations. For an example Cancel button. This snippets shows how to skip form validation for button. Works in Drupal 7.
Source code viewer
// Cancel button example. '#type' => 'submit', '#value' => t('Cancel'), ); function MODULE_submit_cancel(&$form, &$form_state) { drupal_goto('<front>'); }Programming Language: PHP