Is there a way to throw a validation exception but with NO flash message?

I use this code in my ajax handle for a form:

if ($validator->fails()) {
         throw new ValidationException($validator);
      } else { ... }

But I capture the errors below each form field using a

<span data-validate-for="..."></span>

So I would like that the upper red flash message wouldn’t appear.

Sorry, I found the solution myself, but I post it here just in case someone finds it helpfull.
I was adding the “data-request-flash” to the form. Just by removing it, the flash message is not shown, but the proper errors do.

1 Like

but i think there is still a problem, after a successfull form submission, I would have liked to show a flash success message and by removing data-request-flash, it wont work.

Oh, I see your point. I hadn’t spotted that cause in my forms I use to redirect to a thank you page after succesfull submission. I don’t know if there’s a way then to throw the exception without flash message.