diff --git a/fields/types/boolean/BooleanType.js b/fields/types/boolean/BooleanType.js index 20c63070fd..220721e153 100644 --- a/fields/types/boolean/BooleanType.js +++ b/fields/types/boolean/BooleanType.js @@ -36,7 +36,7 @@ boolean.prototype.validateInput = function (data, callback) { boolean.prototype.validateRequiredInput = function (item, data, callback) { var value = this.getValueFromData(data); - var result = (value && value !== 'false') || item.get(this.path) ? true : false; + var result = (value && value !== 'false') || typeof item.get(this.path) === 'boolean' ? true : false; utils.defer(callback, result); }; diff --git a/fields/types/number/NumberType.js b/fields/types/number/NumberType.js index 5c4c6b8ae1..65c7714d59 100644 --- a/fields/types/number/NumberType.js +++ b/fields/types/number/NumberType.js @@ -39,7 +39,7 @@ number.prototype.validateInput = function (data, callback) { number.prototype.validateRequiredInput = function (item, data, callback) { var value = this.getValueFromData(data); var result = !!(value || typeof value === 'number'); - if (value === undefined && item.get(this.path)) { + if (value === undefined && typeof item.get(this.path) === 'number') { result = true; } utils.defer(callback, result);