Update email regex to match Rails

This commit is contained in:
Erik Michaels-Ober 2011-03-05 08:46:26 -08:00
parent 48b6e84013
commit 27fc84552d
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@
$('.combo_form').data('state', 'new'); $('.combo_form').data('state', 'new');
$('.combo_form').submit(function() { $('.combo_form').submit(function() {
var errors = [] var errors = []
if(!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]+$/.test($('.email').val())) { if(!/[\w.!#\$%+-]+@[\w-]+(?:\.[\w-]+)+/.test($('.email').val())) {
errors.push($('.email')); errors.push($('.email'));
$('.email_label').addClass('error', 500); $('.email_label').addClass('error', 500);
$('.email').addClass('error', 500); $('.email').addClass('error', 500);