Been messing with this for a couple days and have not yet solved the riddle of why the .submit() is firing repeatedly. The ".then()" block doesn't fire unless the button is clicked, but without the .submit() I haven't been able to get it to submit on first interaction with the button. With .submit() the form submits continuously until the redirect behavior takes place (redirect to thank you page, etc).
The .submit() method starts the submit flow: performs validation, fires any .onSubmit() events, submits the form, and fires any .onSuccess() events if form submission was successful.
Calling .submit() from within .onValidate() explicitly creates an infinite loop.
may be sufficient to prevent the looping. I believe that will also submit the form on the first click as it moves this code outside of that flow.
Have you or do you know of anyone who has posted steps to creating the server side of implementing reCAPTCHA v3, the webhook and smart campaigns?
Apologies, I have the method deployed at several sites but have been too busy to write it up yet.
In the Landing Page HTML, or in a separate .JS file, is a lot easier to manage than trying to embed in a Rich Text area.
Is it necessary to add the top portion of the script?
I ask because I notice you reference a specific form in this script, and the template I edited uses many different forms. I was concerned that if I add the part at top it would cause a problem if I use a form different than the one referenced here.
I tried adding just the bottom part of the script to the template and it seems to be working correctly, but I just wanted to confirm if the top portion is necessary. Thanks!
Put this right BEFORE the <body> tag:
<!-- standard embed code -->
<script>MktoForms2.loadForm("//app-sj20.marketo.com", "122-YZF-525", 1428);</script>
<!-- /standard embed code -->