function _webform_validate_email in Webform 5.2
Same name and namespace in other branches
- 5 components/email.inc \_webform_validate_email()
- 6.3 components/email.inc \_webform_validate_email()
- 6.2 components/email.inc \_webform_validate_email()
- 7.4 components/email.inc \_webform_validate_email()
- 7.3 components/email.inc \_webform_validate_email()
A Drupal Forms API Validation function. Validates the entered values from email components on the client-side form.
Parameters
$formelement: An array of information describing the component, directly correlating to the webform_component database schema.
Return value
True if successful, calls a form_set_error if the email is not valid.
File
- components/
email.inc, line 139 - Webform module email component.
Code
function _webform_validate_email($form_element, $component) {
if (!empty($form_element['#value']) && !valid_email_address($form_element['#value'])) {
form_error($form_element, t('%value is not a valid email address.', array(
'%value' => $form_element['#value'],
)));
}
}