| 123456789101112131415161718192021 |
- (function($) {
- $.extend($.bootstrapValidator.validator, {
- emailAddress: {
- /**
- * Return true if and only if the input value is a valid email address
- *
- * @param {bootstrapValidator} validateInstance Validate plugin instance
- * @param {HTMLElement} element
- * @param {Object} options
- * @returns {boolean}
- */
- validate: function(validateInstance, element, options) {
- var value = $.trim($(element).val()),
- // Email address regular expression
- // http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
- emailRegExp = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
- return emailRegExp.test(value);
- }
- }
- });
- }(window.jQuery));
|