Currently, the form fields' are being highlighted in red from the mktoInvalid class that's being added, even before the user hits on "Submit", as soon as the field has been clicked on. Is there any way to have this validation check run only after the user hits on Submit? Thanks!
Solved! Go to Solution.
Yes, Min, you can do this.
Using CSS, hide the .mktoError and related styles by default. Then, in a custom onValidate function, restore the visibility (an easy way is to add a class to the <FORM> that overrides the previous styles). The onValidate does not run when entering or leaving the field, but only (by default) when the submit button is pressed.
Marketo has validation rules turned on for some fields, for example Email should be a valid Email Address, clicking on and off the field will activate the error message, other field types have the same sort of features, see here - Custom Field Type Glossary - Marketo Docs - Product Docs
Yes, Min, you can do this.
Using CSS, hide the .mktoError and related styles by default. Then, in a custom onValidate function, restore the visibility (an easy way is to add a class to the <FORM> that overrides the previous styles). The onValidate does not run when entering or leaving the field, but only (by default) when the submit button is pressed.