function _webform_validate_email in Webform 5
Same name and namespace in other branches
- 5.2 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 91
Code
function _webform_validate_email($formelement, $name) {
if (!empty($formelement['#value']) && !valid_email_address($formelement['#value'])) {
form_set_error($name, t("'%value' is not a valid email address", array(
'%value' => $formelement['#value'],
)));
}
}