Created
May 10, 2017 22:53
-
-
Save jonbjornn/89ca159f2b40815bfe54ada1262fd467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/** | |
* Do not remove this section; it allows our team to troubleshoot and track feature adoption. | |
* TS:0002-07-017 | |
*/ | |
lp.jQuery(function($) { | |
// Replace email_address with the actual ID of your form field. | |
var field = 'email_address'; | |
// Optionally change this to customize the validation error that your visitors will see if they enter a webmail address. | |
var message = 'Please enter your work mail address.'; | |
var rules = module.lp.form.data.validationRules[field]; | |
$.validator.addMethod('notWebmail', function(value, field) { | |
var valid = /\@(?!(me|mac|icloud|gmail|googlemail|hotmail|live|msn|outlook|yahoo|ymail|aol)\.)/.test(value.toLowerCase()); | |
return valid || (!rules.required && !value); | |
}, message); | |
rules.notWebmail = true; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment