AnsweredAssumed Answered

How can I limit when Marketo forms call their validation method?

Question asked by 3d1724fb4ef4f86e70069d025fa4b0bf3d8962cd on Sep 22, 2014
Latest reply on Oct 6, 2014 by 3d1724fb4ef4f86e70069d025fa4b0bf3d8962cd

I've implemented a floating label pattern, like this one:

You can see my version working properly in the form at

That's a regular form that uses a workaround to send the data at an associated Marketo landing page. Not ideal. 

Embedding forms into pages with the API is a much more sustainable solution, but it has issues that can be seen on if you click the "Subscribe Now" button in the sidebar without typing anything in. 

It should result in you getting errors that overlap with other labels. Gross.

The way Marketo handles validation makes it really hard for me to either:

A) Detect the moment when Marketo has inserted an error message
B) Use a different, first layer of validation before submission that is easier for me to control, such as jQuery's validate plugin.

I tried using the onValidate() callback function, but it only works on submit. The docs list the same named function (onValidate(callback)) twice with two different use cases, but I only can make the submit one work. Kinda leaves me scratching my head. 

I'm totally open to new ways of doing this. Right now my first idea is to limit the calls to Marketo's validation function.

Do you have any thoughts/ideas on how to solve this issue? Thanks in advance!