You are here

function ContactComponent::wf_crm_contact_component_required in Webform CiviCRM Integration 8.5

Validation callback

Parameters

array $element:

array $form_state:

File

src/ContactComponent.php, line 353

Class

ContactComponent
Class ContactComponent

Namespace

Drupal\webform_civicrm

Code

function wf_crm_contact_component_required($element, &$form_state) {
  if (empty($element['#value'])) {
    form_error($element, t('@name field is required.', [
      '@name' => $element['#title'],
    ]));
  }
}