Skip to main content
sydney-3
Level 2
Sep 29, 2020 2:38 PM UTC
Question

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

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.

5 replies

SanfordWhiteman
User Group Leader
User Group Leader
Sep 29, 2020 4:44 PM UTC

Don't see a link.

Translate
sydney-3
sydney-3Author
Level 2
Oct 1, 2020 4:45 PM UTC

Just updated! 

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 1, 2020 7:34 PM UTC

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.)

Translate