Is there a browser-side validation passed event I can listen for? Is there a JS event that my own custom code can listen for to determine that client-side / browser validation of a form has passed?
i.e. That no messages like this have occurred: &quot;Please fill in this field&quot; because a field was empty.

If there such an event that can be listened to then my own JS could handle the POST submission and then replace the form with a thank you message, in-situ / in place on the same page.
What I don't want to do is have my code run whether the form submission input by the user is valid or not. In other words I don't want to display a thank you message if they've not given valid data. That's why I need an event to say validation passed.
This to me is a better solution to say &quot;thank you&quot; rather than redirecting to content that can itself be indexed and accessed &quot;outside&quot; of the form submit situation, even if a module like rabbit_hole is used.
Looking for a Drupal 8 or 9 solution for myself but tagged with 7 to encourage answers for those who also might want an answer but for Drupal 7.
Drupal doesn't have a browser-side validation framework as it does with the back-end form validation handlers. The &quot;Please fill...&quot; message is the browser enforcing the required property.
If you'd like to hook into those validation events, you can bind event listeners on specific form elements for invalid events. If you want to take action on a submit click, the checkValidity() method can be executed on form field DOM objects.
See the MDN docs on the constraint validation API for more info.