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
Hello!

I've implemented a floating label pattern, like this one:
http://dribbble.s3.amazonaws.com/users/6410/screenshots/1254439/form-animation-_gif_.gif

You can see my version working properly in the form at http://www.mobify.com/contact

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 http://www.mobify.com/blog/ 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!

Outcomes