Hi There,
The goal is that once someone visits the page with utm parameters they submit the form and once they do i save those values as a cookie that way anytime someone revisits and gets the known visitor page I can resend those saved cookie values once they click the Known Visitor button.
I have changed the implementation to use the form object from
MktoForms2.whenReady
and call submit on this click of the button . The issue still remains and it looks like nothing is happening on the page.
however when I click on that button it seems to do nothing but it does show a console error
The goal is that once someone visits the page with utm parameters they submit the form and once they do i save those values as a cookie that way anytime someone revisits and gets the known visitor page I can resend those saved cookie values once they click the Known Visitor button.
I’m sure that’s the intent, but your JS is broken in numerous ways.
however when I click on that button it seems to do nothing but it does show a console error
Yes, and you can easily debug that error. Not sure why you didn’t look further into it yourself.
The error is because you have a custom onValidate function to reject non-business emails, and you’re adding the listener in both standard and KV HTML mode.
Needless to say, you can’t validate the Email value when the <input name="Email"> element is not even present on the form. The direct cause is that Marketo can’t find a place to put your custom error message. The root cause is you can’t validate fields that aren’t there.
Also, your custom function has a fundamental bug because you’re not escaping the special regex dot. /@(aol.com)$/i matches the string joe@aolecom.