Javascript insert to prevent form submission based on field formatting

I was not able to get the code working in its current state. I was adding it as a snippet, and using the hosted form. If you host the form (by copying the HTML), then you might have better luck, but that will also require some editing of the provided HTML (you’ll notice there is a submit action which is likely conflicting with the code you’re trying to add: onsubmit="submitWebForm()" which you can modify if you’re hosting it yourself)

You can find some info in this comment:
Do something with Campaign Web Form before POST submission to infusionsoft - Jul '20

Hope this helps!