4

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?

Jared
  • 5,840
  • 5
  • 49
  • 83
  • 3
    Posting some code would probably be helpful. – Colin Brock Feb 02 '12 at 21:38
  • @Colin not sure how this would help (I don't say this to be a jerk just don't see how it's relevant)? I'm not debugging I'm trying to find if a capability is built in or not. It's a general question that has no basis on my code what so ever. Thanks to 3nigma for answer below. Worked like a charm! – Jared Feb 03 '12 at 02:43
  • Fair enough. Admittedly, I probably skimmed your question initially and didn't thoroughly read it - so, my apologies. It's a pretty regular occurrence on here for people to post questions that are difficult to answer without seeing the code in question. This one certainly isn't though! Good luck on your project! – Colin Brock Feb 03 '12 at 03:47

1 Answers1

8

you can try

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

    else{
          //invalid form 
    }
  }
});
Rafay
  • 30,950
  • 5
  • 68
  • 101