You are here

function clientside_validation_webform_form_webform_component_edit_form_alter in Clientside Validation 7

Same name and namespace in other branches
  1. 7.2 clientside_validation_webform/clientside_validation_webform.module \clientside_validation_webform_form_webform_component_edit_form_alter()

File

clientside_validation_webform/clientside_validation_webform.module, line 416
Adds clientside validation support for the webform module

Code

function clientside_validation_webform_form_webform_component_edit_form_alter(&$form, &$form_state, $form_id) {
  $component = $form_state['build_info']['args'][1];
  $form['validation']['exclude_cv'] = array(
    '#type' => 'checkbox',
    '#title' => 'Exclude from clientside validation',
    '#description' => 'Check this option if you do not want to add clientside validation.',
    '#default_value' => isset($component['extra']['exclude_cv']) ? $component['extra']['exclude_cv'] : FALSE,
  );
  array_unshift($form['#submit'], 'clientside_validation_webform_webform_component_edit_form_submit');
}