This content has been marked as final. Show 2 replies
There is some documentation on Marketo's Developer site about how to manipulate Form code. In order to add custom behavior you need to embed the Form 2.0 code on page and inject your custom script into it (all outlined in the documentation below).
I would recommend looking at #9 on the link below, it gives an example of validation on submit.
As @Max S says, hook the onValidate event.
Another simple, runnable example here.
Note the Marketo Forms 2.0 object model/API is an enhanced wrapper around a real HTML <FORM>. This is great because it allows you to use standard <FORM> behaviors (such as the native onSubmit event) and interrogate the form element in the DOM -- if absolutely necessary. However you should strive to use the supported Forms 2.0 API everywhere you can to avoid confusion.