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

Anonymous
Not applicable
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
Anonymous
Not applicable
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.
Anonymous
Not applicable
Additional note, you would need to use a bit of css to move the message
Anonymous
Not applicable
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";
}
Josh_Hill13
Level 10 - Champion Alumni
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/