inputEx Documentation Back to homepage

### inputEx Documentation > EmailField.js 0.2.2

This is the source view for EmailField.js

(function() { var inputEx = YAHOO.inputEx; /** * @class Field that adds the email regexp for validation. Result is always lower case. * @extends inputEx.StringField * @constructor * @param {Object} options inputEx.Field options object */ inputEx.EmailField = function(options) { inputEx.EmailField.superclass.constructor.call(this,options); }; YAHOO.lang.extend(inputEx.EmailField, inputEx.StringField, /** * @scope inputEx.EmailField.prototype */ { /** * Set the email regexp and invalid message * @param {Object} options Options object (inputEx inputParams) as passed to the constructor */ setOptions: function(options) { inputEx.EmailField.superclass.setOptions.call(this, options); // Overwrite options this.options.messages.invalid = inputEx.messages.invalidEmail; this.options.regexp = inputEx.regexps.email; }, /** * Set the value to lower case since email have no case * @return {String} The email string */ getValue: function() { return this.el.value.toLowerCase(); } }); // Specific message for the email field inputEx.messages.invalidEmail = "Invalid email, ex: sample@test.com"; /** * Register this class as "email" type */ inputEx.registerType("email", inputEx.EmailField); })();

Copyright (c) 2007-2009 Eric Abouaf. All rights reserved.
Generated by JsDoc Toolkit 2.0.0 on Wed, 04 Mar 2009 15:41:29 GMT using neyricjslibs-template.