Skip to content

#1912 Add docs for Validator.destroy() on the webpage. #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions entries/Validator.destroy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
<entry type="method" name="Validator.destroy">
<title>Validator.destroy()</title>
<signature>
</signature>
<desc>Destroys this instance of validator freeing up resources and unregistering events.</desc>
<longdesc>This is only useful, when you need to clean up after the validator in a Single Page Application.</longdesc>
<example>
<desc>Destroying an instance of validator.</desc>
<code><![CDATA[
/*
* 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.
*/
]]></code>
</example>
<category slug="validator"/>
</entry>
1 change: 1 addition & 0 deletions pages/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The validate method returns a Validator object that has a few public methods tha
* [`Validator.resetForm()` - Resets the controlled form.](/Validator.resetForm)
* [`Validator.showErrors()` - Show the specified messages.](/Validator.showErrors)
* [`Validator.numberOfInvalids()` - Returns the number of invalid fields.](/Validator.numberOfInvalids)
* [`Validator.destroy()` - Destroys this instance of validator.](/Validator.destroy)

There are a few static methods on the validator object:

Expand Down