File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <?xml-stylesheet type =" text/xsl" href =" ../entries2html.xsl" ?>
3
+ <entry type =" method" name =" Validator.destroy" >
4
+ <title >Validator.destroy()</title >
5
+ <signature >
6
+ </signature >
7
+ <desc >Destroys this instance of validator freeing up resources and unregistering events.</desc >
8
+ <longdesc >This is only useful, when you need to clean up after the validator in a Single Page Application.</longdesc >
9
+ <example >
10
+ <desc >Destroying an instance of validator.</desc >
11
+ <code ><![CDATA[
12
+ /*
13
+ * On SPA page start.
14
+ */
15
+ var validator = $( "#myform" ).validate();
16
+
17
+ /*
18
+ * Just before SPA page's navigation away.
19
+ */
20
+ validator.destroy();
21
+
22
+ /*
23
+ * After this point the #myForm form is back to its original boring state.
24
+ */
25
+ ]]> </code >
26
+ </example >
27
+ <category slug =" validator" />
28
+ </entry >
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ The validate method returns a Validator object that has a few public methods tha
95
95
* [ ` Validator.resetForm() ` - Resets the controlled form.] ( /Validator.resetForm )
96
96
* [ ` Validator.showErrors() ` - Show the specified messages.] ( /Validator.showErrors )
97
97
* [ ` Validator.numberOfInvalids() ` - Returns the number of invalid fields.] ( /Validator.numberOfInvalids )
98
+ * [ ` Validator.destroy() ` - Destroys this instance of validator.] ( /Validator.destroy )
98
99
99
100
There are a few static methods on the validator object:
100
101
You can’t perform that action at this time.
0 commit comments