Javascript cleanup; new functionality; added jquery-ui

This commit is contained in:
Malishev Dmitry 2011-09-05 18:55:29 +03:00
commit 53a0268227
6 changed files with 68 additions and 43 deletions

View file

@ -25,6 +25,12 @@ App.Validate.getFieldName = function(elm)
}
App.Validate.Rule = {
'username' : function(elm) {
if ($(elm).val().trim() != '' && $(elm).val().search(/[^a-zA-Z_]+/) != -1) {
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is required'};
}
return {VALID: true};
},
'required' : function(elm) {
if ($(elm).val().trim() == '') {
return {VALID: false, ERROR: App.Validate.getFieldName(elm) + ' is required'};