lib/public/javascripts/edifice/edifice_form.js in edifice-0.6.0 vs lib/public/javascripts/edifice/edifice_form.js in edifice-0.6.1

- old
+ new

@@ -55,12 +55,12 @@ }; $field.data('validator', validator); }, // validate a single field - validate: function($field) { - var validator; - if (validator = $field.data('validator')) { + validate: function($field, validator) { + if (typeof validator === 'undefined') { validator = $field.data('validator'); } + if (validator) { var error = validator($field), valid = error === true; this.clear_error($field); if (!valid) { this.add_error($field, error); } \ No newline at end of file