Sha256: 12f1b173e042804b330b1723719e1c701228d3c31fe099c4a48710e980bbfd77
Contents?: true
Size: 1.08 KB
Versions: 39
Compression:
Stored size: 1.08 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== sc_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'); if (SC.none(value)) { return NO; } if (! SC.none(value.length)) { return value.length > 0; } return YES; }, validateError: function(form, field) { var label = field.get('errorLabel') || 'Field' ; return SC.$error(SC.String.loc("Invalid.NotEmpty(%@)", SC.String.capitalize(label)), field.get('errorLabel')); } }) ;
Version data entries
39 entries across 39 versions & 1 rubygems