mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-07-13 16:43:33 -07:00
js / index.html update set
This commit is contained in:
parent
6ceecb886e
commit
8155d2cd9c
5 changed files with 55 additions and 27 deletions
|
@ -30,7 +30,7 @@ App.Validate.Rule = {
|
|||
if ($(elm).val().trim() == '' || $(elm).val().search(/[^a-zA-Z_]+/) != -1) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is invalid'};
|
||||
}
|
||||
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ App.Validate.Rule = {
|
|||
if ($(elm).val().trim() == '') {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is required'};
|
||||
}
|
||||
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ App.Validate.Rule = {
|
|||
if ($(elm).val().trim() != '' && $(elm).val().search(/[^a-zA-Z_]+/) != -1) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is invalid'};
|
||||
}
|
||||
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
|
||||
}
|
||||
return {VALID: true};
|
||||
|
@ -78,7 +78,7 @@ App.Validate.Rule = {
|
|||
if ($(elm).val().trim() != '' && $(elm).val().search(/[^a-zA-Z]+/) != -1) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' must contain only letters without spaces or other symbols'};
|
||||
}
|
||||
if ($(elm).val().trim() == '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
if ($(elm).val().trim() != '' || $(elm).val().length > App.Settings.FIELD_MAX_LEN) {
|
||||
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' too long'};
|
||||
}
|
||||
return {VALID: true};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue