diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index cfd65fbc73..8b866ddb2f 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -762,12 +762,12 @@ $.fn.form = function(parameters) { ? rule : [rule] ; - if(rule == undefined) { - module.debug('Removed all rules'); - validation[field].rules = []; + if(validation[field] === undefined || !Array.isArray(validation[field].rules)) { return; } - if(validation[field] == undefined || !Array.isArray(validation[field].rules)) { + if(rule === undefined) { + module.debug('Removed all rules'); + validation[field].rules = []; return; } $.each(validation[field].rules, function(index, rule) {