Help with code to block internal distribution lists using standard Marketo code | Community
Skip to main content
sydney-3
New Participant
September 29, 2020
Question

Help with code to block internal distribution lists using standard Marketo code

  • September 29, 2020
  • 1 reply
  • 2178 views

Hello,

 
We are trying to block internal listservs from being able to fill out forms using the standard code provided by Marketo (typically used to block freemail addresses). 
 
When we add the script to a Marketo LP it works perfectly, but when we add it to a page on our site it does not work at all.
 
Here is a URL where the script is live (https://www.numerator.com/ecommerce-acceleration-index). Any help would be greatly appreciated.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

SanfordWhiteman
New Participant
September 29, 2020

Don't see a link.

sydney-3
sydney-3Author
New Participant
October 1, 2020

Just updated! 

SanfordWhiteman
New Participant
October 1, 2020

Error in your code.

 

You can't seek the input by id, it has to be by name.

 

var emailElem = form.getFormElem().find("#Email");

 

must be

 

var emailElem = form.getFormElem().find("input[name='Email']");

 

Also, you're including the email validation code twice, should only be once. 

 

(And that code is inherently buggy as it's case-sensitive and doesn't look at domains correctly, but that's another story.)