Hi all,
On several landing pages, I would like to prevent personal email addresses (yahoo, gmail, hotmail etc.) from being filled out on the form.
Initially, I thought I could edit some rules in the form, but this seems to be impossible. I do not want to edit my template, as it would effect all my landing pages.
Does anyone know how to ensure that only on a few landing pages, I "forbid" email addresses containing a certain domain name from being entered?
I found another discussion in the Marketo community referring to a certain HTML script, which should work. Unfortunately, I cannot get it to function properly.
Appreciate all the help!
Thanks,
Tom
If anyone can't get this script working like I haven't been able to for the last hour, here is a tip. Make sure the script is after the form in the HTML of the page. That solved it for me.
Here's an idea - feel free to shoot it down, but...
You would have to make a change to your template. Where you have your other scripts, put in {{my.Custom-Script}}.
Now, copy the above mentioned code, open up notepad, paste it and save it as restrict-public-email.js. Upload it into design studio and grab the URL.
In the programs you want it, past <script src="<insert URL here>"> into your Custom-Script text token.
Thanks Robb. I'll definitely try that one out.
Yes I did! This is the HTML script I tried, but it does not work. Furthermore, the article is about 2 years old, so perhaps outdated?
I'm hoping for new information that could help me.
Thanks,
Tom
That should still work...is this an embedded form on an external webpage? Or are you using a Marketo landing page?
Hi Justin,
Should it also work on a Marketo landing page? And if so, would you know where to implement it?
Thanks!
A MktoForms2.whenReady listener works on Marketo or non-Marketo pages.
Please link to your URL so we can troubleshoot actual code.
Is there a way to get the code http://developers.marketo.com/blog/restrict-free-email-domains-on-form-fill-out/ to work for Alternate Email Address field on my form too?
Thanks
Danielle Chan without in any way retracting my critique of that old code, here's how you'd use it for multiple email fields: MktoForms2 :: Multiple Email fields w/questionable validation
Again, though, not really the complete/correct way to match freemail domains.
Hi Sanford, do you know how to edit the code so that the error alert message appears just above the submit button in addition to near the field? I have a long form, and I'd like the message to appear when they click the submit button so they don't have to scroll up and down looking for why the form isn't submitting. Thank you!
The native error message can only be in one place at a time.
But check the CodePen now. I added the option showMessageNearSubmit. If you set this to true (defaults to false) then the message also appears next to the Submit button. You can style the message using CSS.
Thanks Sanford. I was able to try it out on the codepen link. The code we decided to use is a bit different from yours, so I don't think I can implement your code. For example, here is a sample page with the code we are using. IEEE
Thanks so much Sanford!
Yes, but you shouldn't be using that code anyway as it's broken (it will say danielle@outlook.chanco.com and chris@live.vandermerel.net are free emails, when that's obviously not true).
You can find better code by searching the Community, and I can help you adapt it to check multiple email-type fields.
I am using a Marketo landing page.