Script to allow only business email id’s in Landing pages.

This script will allows you to capture only business email id’s in your responsive landing pages. If you wish to avoid spam submissions and capture only business email id’s of the visitor, you can use this script in your landing pages.

Navigate to Marketing -> Landing pages -> Create Landing Page/ Edit Landing Page -> Step 4 : Page Settings, in Embed script Inside Head section place this below code.

This code will restrict free email id’s like Gmail, Yahoo and Hotmail. If you would like to restrict any other domain, contact support for updated script.

Sent Data

<script  type="text/javascript">
var $ = jQuery;
$(document).ready(function(e){
$('#form-submit-button').click(function(){
var email = $('#EmailAddress').val();
var reg = /^([w-.]+@(?!gmail.com)(?!yahoo.com)(?!hotmail.com)(?!yahoo.co.in)(?!aol.com)(?!abc.com)(?!xyz.com)(?!pqr.com)(?!rediffmail.com)(?!live.com)(?!outlook.com)(?!me.com)(?!msn.com)(?!ymail.com)([w-]+.)+[w-]{ 2, 4 })?$/;
if (reg.test(email)){
return 0;
}
else{
alert('Please Enter Business Email Address');
return false;
}
});
});
</script>