function _clientside_validation_set_email in Clientside Validation 6
Same name and namespace in other branches
- 7 clientside_validation.module \_clientside_validation_set_email()
Set validation rule for email fields.
3 calls to _clientside_validation_set_email()
- clientside_validation_cck in clientside_validation_form/
clientside_validation_form.module - clientside_validation_webform_after_build_recurse in clientside_validation_webform/
clientside_validation_webform.module - _clientside_validation_set_fapi_validation in clientside_validation_fapi/
clientside_validation_fapi.module - Set fapi validation.
File
- ./
clientside_validation.module, line 961 - Add client side validation to a webform.
Code
function _clientside_validation_set_email($name, $title, &$js_rules, $message = '') {
$title = variable_get('clientside_validation_prefix', '') . $title . variable_get('clientside_validation_suffix', '');
$js_rules[$name]['email'] = TRUE;
$variables = array(
'message' => empty($message) ? 'The value in !title is not a valid email address.' : $message,
'placeholders' => empty($message) ? array(
'!title' => $title,
) : array(),
'error_type' => 'email',
'element_name' => $name,
);
$js_rules[$name]['messages']['email'] = theme('clientside_error', $variables);
}