Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit 1068062

Browse files
committed
added back Validator Rules in Readme
1 parent 2d71a7e commit 1068062

File tree

1 file changed

+75
-1
lines changed

1 file changed

+75
-1
lines changed

readme.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,78 @@ When used with IIS, you will need to map the JSON type
103103
```
104104

105105
###License
106-
[MIT License](http://www.opensource.org/licenses/mit-license.php)
106+
[MIT License](http://www.opensource.org/licenses/mit-license.php)
107+
108+
###Available Validator Rules
109+
All validators are written as `snake_case` but it's up to the user's taste and could also be used as `camelCase`. So for example `alpha_dash_spaces` and `alphaDashSpaces` are both equivalent.
110+
111+
##### NOTE: on an `input type="number"`, the `+` sign is an invalid character (browser restriction) even if you are using a `signed` validator. If you really wish to use the `+`, then change your input to a `type="text"`.
112+
113+
* `alpha` Only alpha characters (including latin) are present (a-z, A-Z)
114+
* `alpha_spaces` Only alpha characters (including latin) and spaces are present (a-z, A-Z)
115+
* `alpha_num` Only alpha-numeric characters (including latin) are present (a-z, A-Z, 0-9)
116+
* `alpha_num_spaces` Only alpha-numeric characters (with latin & spaces) are present (a-z, A-Z, 0-9)
117+
* `alpha_dash` Only alpha-numeric characters + dashes, underscores are present (a-z, A-Z, 0-9, _-)
118+
* `alpha_dash_spaces` Alpha-numeric chars + dashes, underscores and spaces (a-z, A-Z, 0-9, _-)
119+
* `between_date_iso:d1,d2` alias of `between_date_iso`.
120+
* `between_date_euro_long:d1,d2` alias of `date_euro_long_between`.
121+
* `between_date_euro_short:d1,d2` alias of `date_euro_short_between`.
122+
* `between_date_us_long:d1,d2` alias of `date_us_long_between`.
123+
* `between_date_us_short:d1,d2` alias of `date_us_short_between`.
124+
* `between_len:min,max` Ensures the length of a string is between a min,max length.
125+
* `between_num:min,max` Ensures the numeric value is between a min,max number.
126+
* `credit_card` Valid credit card number (AMEX, VISA, Mastercard, Diner's Club, Discover, JCB)
127+
* `date_iso` Ensure date follows the ISO format (yyyy-mm-dd)
128+
* `date_iso_between:d1,d2` Ensure date follows the ISO format and is between (d1) & (d2)
129+
* `date_iso_max:d` Date must follow ISO format and is lower or equal than date (d)
130+
* `date_iso_min:d` Date must follow ISO format and is higher or equal than date (d)
131+
* `date_euro_long` Date must follow the European long format (dd-mm-yyyy) or (dd/mm/yyyy)
132+
* `date_euro_long_between:d1,d2` Date must follow European long format and is between (d1) & (d2)
133+
* `date_euro_long_max:d` Date must follow European long format and is lower or equal than date (d)
134+
* `date_euro_long_min:d` Date must follow European long format and is higher or equal than date (d)
135+
* `date_euro_short` Date must follow the Euro short format (dd-mm-yy) or (dd/mm/yy)
136+
* `date_euro_short_between:d1,d2` Date must follow Euro short format and is between (d1) & (d2)
137+
* `date_euro_short_max:d` Date must follow Euro short format and is lower or equal than date (d)
138+
* `date_euro_short_min:d` Date must follow Euro short format and is higher or equal than date (d)
139+
* `date_us_long` Date must follow the US long format (mm-dd-yyyy) or (mm/dd/yyyy)
140+
* `date_us_long_between:d1,d2` Date must follow the US long format and is between (d1) & (d2)
141+
* `date_us_long_max:d` Date must follow US long format and is lower or equal than date (d)
142+
* `date_us_long_min:d` Date must follow US long format and is higher or equal than date (d)
143+
* `date_us_short` Date must follow the US short format (mm-dd-yy) or (mm/dd/yy)
144+
* `date_us_short_between:d1,d2` Date must follow the US short format and is between (d1) & (d2)
145+
* `date_us_short_max:d` Date must follow US short format and is lower or equal than date (d)
146+
* `date_us_short_min:d` Date must follow US short format and is higher or equal than date (d)
147+
* `email` Checks for a valid email address
148+
* `exact_len:n` Ensures that field length precisely matches the specified length (n).
149+
* `float` as to be floating value (excluding integer)
150+
* `float_signed` Has to be floating value (excluding int), could be signed (-/+) positive/negative.
151+
* `iban` Check for a valid IBAN.
152+
* `int` Only positive integer (alias to `integer`).
153+
* `integer` Only positive integer.
154+
* `int_signed` Only integer, could be signed (-/+) positive/negative (alias to `integer_signed`).
155+
* `integer_signed` Only integer, could be signed (-/+) positive/negative.
156+
* `ipv4` Check for valid IP (IPv4)
157+
* `ipv6` Check for valid IP (IPv6)
158+
* `ipv6_hex` Check for valid IP (IPv6 Hexadecimal)
159+
* `match:n` Match another input field(n), where (n) must be the exact ngModel attribute of input field to compare to.
160+
* `match:n,t` Match another input field(n), same as (match:n) but also include (t) for alternate input name to be displayed in the error message (it still uses default translated text, if you really wish to replace the complete text error, then use [:alt](#alternate))
161+
* `max_date_iso` alias of `date_iso_max`.
162+
* `max_date_euro_long` alias of `date_euro_long_max`.
163+
* `max_date_euro_short` alias of `date_euro_short_max`.
164+
* `max_date_us_long` alias of `date_us_long_max`.
165+
* `max_date_us_short` alias of `date_us_short_max`.
166+
* `max_len:n` Checks field length, no longer than specified length where (n) is length parameter.
167+
* `max_num:n` Checks numeric value to be lower or equal than the number (n).
168+
* `min_date_iso` alias of `date_iso_min`.
169+
* `min_date_euro_long` alias of `date_euro_long_min`.
170+
* `min_date_euro_short` alias of `date_euro_short_min`.
171+
* `min_date_us_long` alias of `date_us_long_min`.
172+
* `min_date_us_short` alias of `date_us_short_min`.
173+
* `min_len:n` Checks field length, no shorter than specified length where (n) is length parameter.
174+
* `min_num:n` Checks numeric value to be higher or equal than the number (n).
175+
* `numeric` Only positive numeric value (float, integer).
176+
* `numeric_signed` Only numeric value (float, integer) can also be signed (-/+).
177+
* `regex` Ensure it follows a regular expression pattern... please see [Regex](#regex) section
178+
* `required` Ensures the specified key value exists and is not empty
179+
* `time` Ensure time follows the format of (hh:mm) or (hh:mm:ss)
180+
* `url` Check for valid URL or subdomain

0 commit comments

Comments
 (0)