1

I'm using jQuery.validity to validate PHP form inputs. I need to skip validation when user clicked selected input button (eg: Logout button)

Sample code used for validation:

$("form").validity(function() {
    $("#DateInput") 
        .require()
        .match("date");
});

How to skip validation for selected input buttons?

Charles
  • 50,943
  • 13
  • 104
  • 142
Nalaka526
  • 11,278
  • 21
  • 82
  • 116

2 Answers2

1

I posted this question in Validity official site, issues section. This is the answer given

In general, validation is bound to a form rather than a submit button. If your logout button is in a form you don't want to validate, just don't call validity on that form. e.g. $("#formWithInputs").validity(...)

So managed to make it work by locating input controls in different forms

Nalaka526
  • 11,278
  • 21
  • 82
  • 116
0

make change the logout button to <input id="logout" type="button" /> instead of submit

digitebs
  • 834
  • 8
  • 10