Browse Source

fixed wrong usage of $.inArray in validators

fixes #448
tags/2.0.0-beta
Carsten Brandt 12 years ago
parent
commit
280727408f
  1. 4
      framework/yii/assets/yii.validation.js

4
framework/yii/assets/yii.validation.js

@ -87,8 +87,8 @@ yii.validation = (function ($) {
if (options.skipOnEmpty && isEmpty(value)) {
return;
}
var valid = !options.not && $.inArray(value, options.range)
|| options.not && !$.inArray(value, options.range);
var valid = !options.not && $.inArray(value, options.range) > -1
|| options.not && $.inArray(value, options.range) == -1;
if (!valid) {
messages.push(options.message);

Loading…
Cancel
Save