Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
clientside_validation
Commits
abd0a5bf
Commit
abd0a5bf
authored
Apr 30, 2012
by
Jelle Sebreghts
Browse files
Issue #1551616 by Jumoke: Added Does this work on Tab out?.
parent
330531f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
clientside_validation.admin.inc
View file @
abd0a5bf
...
...
@@ -69,6 +69,18 @@ function clientside_validation_admin_settings() {
'#default_value'
=>
variable_get
(
'clientside_validation_validate_onblur'
,
1
),
);
$form
[
'clientside_validation_validate_options'
][
'clientside_validation_validate_onblur_always'
]
=
array
(
'#type'
=>
'radios'
,
'#options'
=>
array
(
'1'
=>
t
(
'Yes'
),
'0'
=>
t
(
'No'
),
),
'#title'
=>
t
(
'Always validate fields on blur'
),
'#description'
=>
t
(
'Validate elements (except checkboxes/radio buttons) on blur, <strong>even nothing is entered before or if the fields hasn\'t been marked as invalid before.</strong>'
),
'#default_value'
=>
variable_get
(
'clientside_validation_validate_onblur_always'
,
0
),
'#states'
=>
array
(
'visible'
=>
array
(
':input[name=\'clientside_validation_validate_onblur\']'
=>
array
(
'value'
=>
1
))),
);
$form
[
'clientside_validation_validate_options'
][
'clientside_validation_validate_onkeyup'
]
=
array
(
'#type'
=>
'radios'
,
'#options'
=>
array
(
...
...
clientside_validation.js
View file @
abd0a5bf
...
...
@@ -332,6 +332,13 @@
if
(
!
Boolean
(
parseInt
(
self
.
data
.
general
.
validateOnBlur
)))
{
validate_options
.
onfocusout
=
false
;
}
if
(
Boolean
(
parseInt
(
self
.
data
.
general
.
validateOnBlurAlways
)))
{
validate_options
.
onfocusout
=
function
(
element
)
{
if
(
!
this
.
checkable
(
element
)
)
{
this
.
element
(
element
);
}
}
}
if
(
!
Boolean
(
parseInt
(
self
.
data
.
general
.
validateOnKeyUp
)))
{
validate_options
.
onkeyup
=
false
;
}
...
...
clientside_validation.module
View file @
abd0a5bf
...
...
@@ -300,6 +300,7 @@ function _clientside_validation_add_general_settings(&$settings, $form_id) {
"scrollSpeed"
=>
(
int
)
variable_get
(
'clientside_validation_scroll_speed'
,
1000
),
"disableHtml5Validation"
=>
variable_get
(
'clientside_validation_disable_html5'
,
1
),
"validateOnBlur"
=>
variable_get
(
'clientside_validation_validate_onblur'
,
1
),
"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
),
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment