Skip to content

Instantly share code, notes, and snippets.

@skipjac
Created July 20, 2015 00:41
Show Gist options
  • Save skipjac/18eb5d7df948aaa6a269 to your computer and use it in GitHub Desktop.
Save skipjac/18eb5d7df948aaa6a269 to your computer and use it in GitHub Desktop.
Validate email in zendesk Help Center ticket forms.
$('input').keyup(function(e){
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if(e.target.name === 'request[anonymous_requester_email]'){
var match = re.test(e.target.value);
console.log(match);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment