|
4 | 4 | <title>jQuery.validator.addMethod()</title>
|
5 | 5 | <signature>
|
6 | 6 | <argument name="name" type="String">
|
7 |
| - <desc>The name of the method, used to identify and referencing it, must be a valid javascript identifier</desc> |
| 7 | + <desc>The name of the method used to identify it and referencing it must be a valid javascript identifier</desc> |
8 | 8 | </argument>
|
9 | 9 | <argument name="method" type="Function">
|
10 | 10 | <desc>The actual method implementation, returning true if an element is valid. First argument: Current value. Second argument: Validated element. Third argument: Parameters.</desc>
|
|
15 | 15 | <desc>the element to be validated</desc>
|
16 | 16 | </property>
|
17 | 17 | <property name="value" type="String">
|
18 |
| - <desc>parameters specified for the method, e.g. for min: 5 the parameter is 5, for range: [1, 5] its [1, 5]</desc> |
| 18 | + <desc>parameters specified for the method, e.g. for min: 5, the parameter is 5, for range: [1, 5] it's [1, 5]</desc> |
19 | 19 | </property>
|
20 | 20 | </argument>
|
21 | 21 | <argument name="message" type="String" optional="true">
|
22 |
| - <desc>The default message to display for this method. Can be a function created by ''jQuery.validator.format(value)''. When undefined, an already existing message is used (handy for localization), otherwise the field-specific messages have to be defined.</desc> |
| 22 | + <desc>The default message to display for this method. Can be a function created by ''jQuery.validator.format(value)''. When undefined, an existing message is used (handy for localization), otherwise the field-specific messages have to be defined.</desc> |
23 | 23 | </argument>
|
24 | 24 | </signature>
|
25 | 25 | <desc>Add a custom validation method. It must consist of a name (must be a legal javascript identifier), a javascript based function and a default string message.</desc>
|
26 | 26 | <longdesc>The arguments to the callback are:
|
27 | 27 | * the current value of the validated element
|
28 | 28 | * the element to be validated
|
29 |
| - * parameters specified for the method, e.g. for min: 5 the parameter is 5, for range: [1, 5] its [1, 5] |
| 29 | + * parameters specified for the method, e.g. for min: 5 the parameter is 5, for range: [1, 5] it's [1, 5] |
30 | 30 |
|
31 |
| -Please note: While the temptation is great to add a regex method that checks it's 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. |
| 31 | +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. |
32 | 32 |
|
33 | 33 | See also a <a href="http://regexlib.com/DisplayPatterns.aspx">library of regular expressions</a>.
|
34 | 34 | </longdesc>
|
|
0 commit comments