Skip to content

Commit 4668f92

Browse files
committed
Some follow-up fixes: No dash in serverside, things, remove note about Google Toolbar (it's dead, right?)
1 parent b21b6cb commit 4668f92

6 files changed

+8
-16
lines changed

entries/accept-method.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<p>Works with type="file" inputs.</p>
1313

14-
<p>Note: This method used to look at just the filename, specifically the file extension. That behaviour is now available as the "extension" method inside additional-methods.js, as is this "accept" method.</p>
14+
<p>Note: This method used to look at just the filename, specifically the file extension. That behaviour is now available as the "extension" method inside src/additional/extension.js.</p>
1515
</longdesc>
1616
<signature>
1717
<argument name="mimetype" type="String">

entries/jQuery.validator.addMethod.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>jQuery.validator.addMethod()</title>
55
<signature>
66
<argument name="name" type="String">
7-
<desc>The name of the method used to identify it and referencing it must be a valid javascript identifier</desc>
7+
<desc>The name of the method used to identify it and referencing it; this must be a valid JavaScript identifier</desc>
88
</argument>
99
<argument name="method" type="Function">
1010
<desc>The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters.</desc>
@@ -31,6 +31,8 @@
3131
Please note: While the temptation is great to add a regex method that checks its parameter against the value, it is much cleaner to encapsulate those regular expressions inside their own method. If you need lots of slightly different expressions, try to extract a common parameter.
3232

3333
See also a <a href="http://regexlib.com/DisplayPatterns.aspx">library of regular expressions</a>.
34+
35+
If you still can't resist, use the "pattern" method.
3436
</longdesc>
3537
<example>
3638
<desc>Add a validation method that checks if a value starts with a certain domain.</desc>

entries/maxlength-method.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Return false if the element is
77
<ul>
88
<li>some kind of text input and its value is too long</li>
9-
<li>a set of checkboxes and has too many boxes checked</li>
9+
<li>a set of checkboxes that has too many boxes checked</li>
1010
<li>a select and has too many options selected</li>
1111
</ul>
1212
<p>Works with text inputs, selects and checkboxes.</p>

entries/minlength-method.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Return false if the element is
77
<ul>
88
<li>some kind of text input and its value is too short</li>
9-
<li>a set of checkboxes and doesn't have enough boxes checked</li>
9+
<li>a set of checkboxes that doesn't have enough boxes checked</li>
1010
<li>a select and doesn't have enough options selected</li>
1111
</ul>
1212
<p>Works with text inputs, selects and checkboxes.</p>

entries/remote-method.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<title>remote method</title>
44
<desc>Requests a resource to check the element for validity.</desc>
55
<longdesc>
6-
The server-side 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.
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.
77

88
<p>For more examples, take a look the <a href="http://jquery.bassistance.de/validate/demo/marketo">marketo demo</a> and the <a href="http://jquery.bassistance.de/validate/demo/milk">milk demo</a>.</p>
99
</longdesc>
1010
<signature>
1111
<argument name="options" type="Object">
1212
<desc>
13-
For the URL of the resource to request for server-side validation (String) or options to fully customize the request, see <a href="http://api.jquery.com/jQuery.ajax">jQuery.ajax</a> for details.
13+
For the URL of the resource to request for serverside validation (String) or options to fully customize the request, see <a href="http://api.jquery.com/jQuery.ajax">jQuery.ajax</a> for details.
1414
<p>These options deep-extend the defaults (<code>dataType:"json", data:{nameOfTheElement:valueOfTheElement}</code>). Any options you provide will override the defaults.</p>
1515
</desc>
1616
</argument>

pages/reference.md

-10
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ All validation rules included here provide a default error message which you can
7272

7373
The priorities are as follows: A custom message (passed by plugin options), the element's title, the default message.
7474

75-
## Error messages and Google Toolbar conflicts
76-
77-
Google Toolbar's AutoFill feature sometimes conflicts with the validation plugin's message display. Google Toolbar replaces the title attribute of an element with some hint at its AutoFill. The validation plugin then uses that title attribute to display it as an error message - not the intended behaviour. One workaround to avoid that is to clear affected elements on DOM load:
78-
79-
<pre><code>
80-
$("input.remove_title").attr("title", "");
81-
</code></pre>
82-
83-
More details in [this article](http://www.dream-revolver.com/2008/04/22/google-toolbar-overwriting-labels-when-using-jquerys-validate-plugin/).
84-
8575
# Error message display
8676
Error messages are handled via label elements with an additional class (option errorClass). The link between the message and the invalid element is provided via the labels for attribute. When provided in the markup, they are shown and hidden accordingly, and otherwise created on demand. By default, labels are created after the invalid element, this is also customizable (option errorPlacement). It is also possible to put them into an error container (option errorLabelContainer). To use a different element then a label, specify the errorElement option.
8777

0 commit comments

Comments
 (0)