Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Catch Client Side Validation failure

I've got a form that I'm submitting based on a div click. I also have it launching a waiting indicator when clicked. I'm trying to find out if there is a way to detect if client side validation failed or not so that I can remove the waiting indicator/never show it after a submit attempt...or can I call the the client side validation manually before I attempt the submit?

like image 792
Jared Avatar asked Feb 21 '23 15:02

Jared


1 Answers

you can try

$('div').click(function() {
    if ($('form').valid()) {
       //form is valid

    else{
          //invalid form 
    }
  }
});
like image 124
Rafay Avatar answered Feb 27 '23 02:02

Rafay