You are here

function webform_components_form_add_validate in Webform 7.4

Same name and namespace in other branches
  1. 6.3 includes/webform.components.inc \webform_components_form_add_validate()
  2. 7.3 includes/webform.components.inc \webform_components_form_add_validate()

Validate handler for webform_component_form() when adding a new component.

1 string reference to 'webform_components_form_add_validate'
webform_components_form in includes/webform.components.inc
The table-based listing of all components for this webform.

File

includes/webform.components.inc, line 331
Webform module component handling.

Code

function webform_components_form_add_validate($form, &$form_state) {

  // Check that the entered component name is valid.
  if (drupal_strlen(trim($form_state['values']['add']['name'])) <= 0) {
    form_error($form['add']['name'], t('When adding a new component, the name field is required.'));
  }
}