Validator.destroy()

Validator.destroy()

Description: Destroys this instance of validator freeing up resources and unregistering events.

Example:

Destroying an instance of validator.

1
2
3
4
5
6
7
8
9
10
11
12
13
/*
* On SPA page start.
*/
var validator = $( "#myform" ).validate();
/*
* Just before SPA page's navigation away.
*/
validator.destroy();
/*
* After this point the #myForm form is back to its original boring state.
*/