Validation messages all at once | Community
Skip to main content
New Participant
February 28, 2022
Question

Validation messages all at once

  • February 28, 2022
  • 2 replies
  • 4328 views

Is there a way (or setting) to display all validation messages at once?

So when there are multiple errors on a form, the user can see all the missing fields and doesn't have to click submit each time to see the next validation error.

 

I'm using the embed solution to include forms in landing pages, using personalized styles for the form and the validation messages.

 

Asking this for Accessibility purposes!

Thanks a lot

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Jo_Pitts1
Community Manager
March 3, 2022

@tonyflywire ,

I'm just trying to clarify the use case.

 

Do you want to do this when the form first displays (i.e. show all fields that are invalid), and then have an ever diminishing number of validation errors as the form is filled in.

 

Cheers

Jo

New Participant
March 3, 2022

Hi @jo_pitts1 

thanks for your reply, will try to explain the user flow.

 

for the first visit, the form is displayed as it is, label and form field. example

First Name

[                       ]

Last Name

[                       ]

City

[                       ]

 

once I click submit, all forms that are invalid should display the validation message.

First Name

[                       ]

First name is required

 

Last Name

[                       ]

Last name is required

City

[                       ]

City name is required

 

and as the fields get filled, and the submit button is clicked again, only the empty or invalid fields will who the validation message.

First Name

[Tony                ]

 

Last Name

[                       ]

Last name is required

City

[New York      ]

 

Right now, once I click submit, the message is shown only on the first invalid field of the form, even if the others are required.

 

First Name

[                       ]

First name is required

 

Last Name

[                       ]

 

City

[                       ]

 

Hope I explained myself better! 🙂

New Participant
April 12, 2022

Hi @tonyflywire 

 

Do we have any solution for this to achieve. If yes can you please provide the solution

SanfordWhiteman
New Participant
March 3, 2022

Sort of beyond the intent of the error messages, but yes, you could trigger onValidate and inject a new element (maybe just a SPAN) that contains the warning message for each element that’s mktoInvalid.

New Participant
March 3, 2022

Thanks @sanfordwhiteman 

is there a way to trigger this via embed code?

Or should this be a line of Javascript I need to add to the webpage?

 

 

SanfordWhiteman
New Participant
March 3, 2022

Or should this be a line of Javascript I need to add to the webpage?


I wouldn’t say “a line” — it’s definitely many lines — but yes, the script needs to live on the page.