Skip to content

Commit

Permalink
Merge pull request #3955 from ScopeyNZ/email-fix
Browse files Browse the repository at this point in the history
Email fix for #3755
  • Loading branch information
jlukic committed Apr 28, 2016
2 parents 2599f71 + 7762e4e commit 92c1cd1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ $.fn.form.settings = {
regExp: {
bracket : /\[(.*)\]/i,
decimal : /^\d*(\.)\d+/,
email : /.+@.+\..+/i,
email : /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
flags : /^\/(.*)\/(.*)?/,
integer : /^\-?\d+$/,
Expand Down Expand Up @@ -1174,10 +1174,7 @@ $.fn.form.settings = {

// is most likely an email
email: function(value){
var
emailRegExp = new RegExp($.fn.form.settings.regExp.email, 'i')
;
return emailRegExp.test(value);
return $.fn.form.settings.regExp.email.test(value);
},

// value is most likely url
Expand Down

0 comments on commit 92c1cd1

Please # to comment.