Sha256: 9920193f3e2468d69594c616a1d4bac4ff5deb73906ef0582d71ccfe861e0c10
Contents?: true
Size: 916 Bytes
Versions: 22
Compression:
Stored size: 916 Bytes
Contents
// ========================================================================== // Not Empty Validator // Author: Charles Jolley // // Force a field to be not empty. // // ========================================================================== require('validators/validator') ; /** Requires some content in field, but does not check the specific content. @class @extends SC.Validator @author Charles Jolley @version 1.0 */ SC.Validator.NotEmpty = SC.Validator.extend( /** @scope SC.Validator.NotEmpty.prototype */ { validate: function(form, field) { var value = field.get('fieldValue'); var ret = !!value ; if (ret && value.length) ret = value.length > 0 ; return ret ; }, validateError: function(form, field) { var label = field.get('errorLabel') || 'Field' ; return $error("Invalid.NotEmpty(%@)".loc(label.capitalize()), field.get('errorLabel')); } }) ;
Version data entries
22 entries across 22 versions & 1 rubygems