How can I display error text separate from the form fields after validation?

Anonymous
Not applicable

How can I display error text separate from the form fields after validation?

Each form field displays error text after validation, but how do I display my own text (eg "Please make sure all the below fields are filled out correctly") independant of the form fields?
Tags (1)
4 REPLIES 4
Josh_Hill13
Level 10 - Champion Alumni

Re: How can I display error text separate from the form fields after validation?

Gabe,

Take a look at some of the articles on using javascript with Marketo forms. You should find links to these articles here:
http://www.marketingrockstarguides.com/marketo-form-instructions-164/
Anonymous
Not applicable

Re: How can I display error text separate from the form fields after validation?

Gabe,

The required message text is in the template

It looks like this:

function fieldValidate(field) {
  /* call Mkto.setError(field, message) and return false to mark a field value invalid */
  /* return 'skip' to bypass the built-in validations */
  return true;
}
function getRequiredFieldMessage(domElement, label) {
  return "This field is required";
}
function getTelephoneInvalidMessage(domElement, label) {
  return "Please enter a valid telephone number";
}
function getEmailInvalidMessage(domElement, label) {
  return "Please enter a valid email address";
}
Anonymous
Not applicable

Re: How can I display error text separate from the form fields after validation?

Additional note, you would need to use a bit of css to move the message
Anonymous
Not applicable

Re: How can I display error text separate from the form fields after validation?

Thanks for responding so quickly. The solution does not seem to create an error message independant of the fields, this solution appears to be exactly for the fields.

Right now I have duplicated the Mkto.validateField function into my landing page, and am appending a separate area on the landing page with text that I only want to display once if any/all form fields are filled out incorrectly/not at all. That's what I meant by independant of the fields.