You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<desc>Requests a resource to check the element for validity.</desc>
5
+
<longdesc>
6
+
The serverside resource is called via jQuery.ajax (XMLHttpRequest) and gets a key/value pair, corresponding to the name of the validated element and its value as a GET parameter. The response is evaluated as JSON and must be <code>true</code> for valid elements, and can be any <code>false</code>, <code>undefined</code> or <code>null</code> for invalid elements, using the default message; or a string, eg. <code>"That name is already taken, try peter123 instead"</code> to display as the error message.
7
+
8
+
<p>For more examples, take a look the <ahref="http://jquery.bassistance.de/validate/demo/marketo">marketo demo</a> and the <ahref="http://jquery.bassistance.de/validate/demo/milk">milk demo</a>.</p>
9
+
</longdesc>
10
+
<signature>
11
+
<argumentname="options"type="Object">
12
+
<desc>
13
+
The URL of the resource to request for serverside validation (String) or options to fully customize the request, see <ahref="http://api.jquery.com/jQuery.ajax">jQuery.ajax</a> for details.
14
+
<p>These options deep-extend the defaults (<code>dataType:"json", data:{nameOfTheElement:valueOfTheElement}</code>). Any options you provide will override the defaults.</p>
15
+
</desc>
16
+
</argument>
17
+
</signature>
18
+
<example>
19
+
<desc>Makes the email field required, an email and does a remote request to check if the given address is already taken.</desc>
20
+
<code><![CDATA[
21
+
$( "#myform" ).validate({
22
+
rules: {
23
+
email: {
24
+
required: true,
25
+
email: true,
26
+
remote: "check-email.php"
27
+
}
28
+
}
29
+
});
30
+
]]></code>
31
+
</example>
32
+
<example>
33
+
<desc>Makes the email field required, an email and does a remote request to check if the given address is already taken. In addition, the http method is set to "post" and the username is sent along side the email address.</desc>
Copy file name to clipboardExpand all lines: entries/rules.xml
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,18 @@
5
5
<longdesc>
6
6
Return the validations rules for the first selected element or
7
7
8
-
Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $("form").validate() is called first or
8
+
<p>Adds the specified rules and returns all rules for the first matched element. Requires that the parent form is validated, that is, $( "form" ).validate() is called first or</p>
9
9
10
-
Removes the specified rules and returns all rules for the first matched element.
10
+
<p>Removes the specified rules and returns all rules for the first matched element.</p>
11
11
12
-
There are several ways to specify validation rules.
12
+
<p>There are several ways to specify validation rules.</p>
13
13
<ul>
14
14
<li>Validation methods without parameters can be specified as classes on the element (recommended)</li>
15
15
<li>Validation methods with parameters can be specified as attributes (recommended)</li>
16
16
<li>Both can be specified as metadata using the metadata plugin</li>
17
17
<li>Both can be specified using the rules-option of the validate()-method</li>
18
18
</ul>
19
-
When setting, the rules can also contain a messages-object, specifying custom messages for existing or added rules.
19
+
<p>When setting, the rules can also contain a messages-object, specifying custom messages for existing or added rules.</p>
|desc=Requests a resource to check the element for validity.
270
-
|longdesc=The serverside resource is called via $.ajax (XMLHttpRequest) and gets a key/value pair, corresponding to the name of the validated element and its value as a GET parameter. The response is evaluated as JSON and must be ''true'' for valid elements, and can be any ''false'', ''undefined'' or ''null'' for invalid elements, using the default message; or a string, eg. ''"That name is already taken, try peter123 instead"'' to display as the error message.
271
-
272
-
For more examples, take a look the [[Plugins/Validation#The_Marketo_sign-up_form|marketo demo]] and the [[Plugins/Validation#The_Remember_The_Milk_sign-up_form|milk demo]].
273
-
|arg0=options
274
-
|arg0type=String, Options
275
-
|arg0desc=The URL of the resource to request for serverside validation (String) or options to fully customize the request, see {{Code|Ajax|jQuery.ajax}} for details.
276
-
}}
277
-
278
-
<noinclude>
279
-
{{APIExamples|
280
-
281
-
{{APIExample|
282
-
|desc=Makes the email field required, an email and does a remote request to check if the given address is already taken.
|desc=Makes the email field required, an email and does a remote request to check if the given address is already taken. In addition, the http method is set to "post" and the username is sent along side the email address.
0 commit comments