mirror of
https://github.com/myvesta/vesta
synced 2025-07-07 13:31:53 -07:00
export from svn
This commit is contained in:
commit
641ed97fdd
340 changed files with 32404 additions and 0 deletions
33
web/js/validators.js
Normal file
33
web/js/validators.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*App.Validate.form = function(values){
|
||||
if(values.IP_ADDRESS == '') {
|
||||
return alert('Not correct ip');
|
||||
}
|
||||
|
||||
return true;
|
||||
}*/
|
||||
|
||||
App.Validate.Is = {
|
||||
ip: function(object) {
|
||||
var ip_regexp = new RegExp(/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/);
|
||||
return ip_regexp.test() ? false : App.i18n.getMessage('incorrect_ip');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
App.Validate.form = function(values, form_ref){
|
||||
// TODO: validate it!
|
||||
return true;
|
||||
var errors = [];
|
||||
$.each(values, function(key) {
|
||||
var value = values[key];
|
||||
/*if ('undefined' != typeof App.Validate.Is[key] ) {
|
||||
if(var error = App.Validate.Is[key](value)) {
|
||||
errors[erros.length++] = error;
|
||||
}
|
||||
}*/
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue