Commit 16bf0831 authored by Jelle Sebreghts's avatar Jelle Sebreghts
Browse files

Issue #1537902 by ramsegal: Added Is it possible to override the error message html? .

parent fc62a7a6
......@@ -141,6 +141,14 @@ function clientside_validation_admin_settings() {
),
);
$form['clientside_validation_error']['clientside_validation_error_element'] = array(
'#title' => t('Error Element'),
'#description' => t('The HTML element to wrap the errors in. Defaults to label.'),
'#type' => 'select',
'#options' => drupal_map_assoc(array('label', 'span', 'div')),
'#default_value' => variable_get('clientside_validation_error_element', 'label'),
);
if (module_exists('fapi_validation') && module_exists('clientside_validation_fapi')) {
$form['clientside_validation_error']['clientside_validation_scroll_speed'] += array('#rules' => array('numeric'));
}
......
......@@ -153,6 +153,7 @@
var validate_options = {
errorClass: 'error',
groups: self.groups[f],
errorElement: self.data.general.errorElement,
unhighlight: function(element, errorClass, validClass) {
// Default behavior
$(element).removeClass(errorClass).addClass(validClass);
......
......@@ -303,6 +303,7 @@ function _clientside_validation_add_general_settings(&$settings, $form_id) {
"validateOnBlurAlways" => (int)(variable_get('clientside_validation_validate_onblur_always', 0) && variable_get('clientside_validation_validate_onblur', 1)),
"validateOnKeyUp" => variable_get('clientside_validation_validate_onkeyup', 1),
"validateOnSubmit" => variable_get('clientside_validation_validate_onsubmit', 1),
"errorElement" => variable_get('clientside_validation_error_element', 'label'),
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment