function _webform_validate_email in Webform 6.2
Same name and namespace in other branches
- 5.2 components/email.inc \_webform_validate_email()
- 5 components/email.inc \_webform_validate_email()
- 6.3 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
$form_element: The e-mail form element.
$form_state: The full form state for the webform.
Return value
None. Calls a form_set_error if the e-mail is not valid.
1 string reference to '_webform_validate_email'
- _webform_render_email in components/
email.inc - Build a form item array containing all the properties of this component.
File
- components/
email.inc, line 141 - Webform module email component.
Code
function _webform_validate_email($form_element, $form_state) {
$component = $form_element['#webform_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'],
)));
}
}