allow multiple validators for one field

users can set MaxDbList and MaxTableList, values are bounded by the original value
This commit is contained in:
Crack
2010-07-17 14:02:19 +02:00
parent afca401bc8
commit a7fe3f362c
6 changed files with 116 additions and 42 deletions

View File

@@ -224,7 +224,20 @@ var validators = {
// convert PCRE regexp
var parts = regexp.match(validators._regexp_pcre_extract);
var valid = this.value.match(new RegExp(parts[2], parts[3])) != null;
return valid ? true : PMA_messages['error_invalid_value']
return valid ? true : PMA_messages['error_invalid_value'];
},
/**
* Validates upper bound for numeric inputs
*
* @param {boolean} isKeyUp
* @param {int} max_value
*/
validate_upper_bound: function(isKeyUp, max_value) {
var val = parseInt(this.value);
if (isNaN(val)) {
return true;
}
return val <= max_value ? true : PMA_messages['error_value_lte'].replace('%s', max_value);
},
// field validators
_field: {