-
Notifications
You must be signed in to change notification settings - Fork 95
Filters
elclanrs edited this page Aug 24, 2012
·
5 revisions
Filter | Description | Sample |
---|---|---|
required |
The field is required. This filter only works with text inputs (text, password, textarea). For select use exclude to exclude the default option. For radio and checkbox use min: 1 which will require at least one option to be checked. | 'name': { filters: 'required' } |
number |
Must be a number. | 'name': { filters: 'number' } |
digits |
Must be only digits. | 'name': { filters: 'digits' } |
range |
Only numbers within a range. Usually combined with number or digits . |
|
name |
Must be at least 3 characters long, and must only contain letters. | 'name': { filters: 'name' } |
username |
Must be between 4 and 32 characters long and start with a letter. You may use letters, numbers, underscores, and one dot (.) | 'name': { filters: 'username' } |
pass |
Must be at least 6 characters long, and contain at least one number, one uppercase and one lowercase letter. | 'name': { filters: 'pass' } |
strongpass |
Must be at least 8 characters long and contain at least one uppercase and one lowercase letter and one number or special character. | 'name': { filters: 'strongpass' } |
email |
Must be a valid e-mail address. | 'name': { filters: 'email' } |
phone |
Must be a valid US phone number. | 'name': { filters: 'phone' } |
zip |
Must be a valid US zip code. | 'name': { filters: 'zip' } |
url |
Must be a valid URL. | 'name': { filters: 'url' } |
date |
Must be a valid date. This filter effectively validates a date, so stuff like 02-31-2012 or 30/80/2000 would be invalid. You can use any format with 4 digit year and any delimiter character. The default format is mm/dd/yyyy . To use the datepicker you need to load jQuery UI and add the class datepicker to your date input. Ideal Forms will apply the custom format that you specify without having to configure the datepicker. It’s seamless. |
|
dob |
Must be a valid date of birth in this century, that is 100 years range from the current year. |
|
min |
Must be at least x characters minimumMust have at least x checkboxes checked. |
|
max |
x characters maximumNo more than x checkboxes checked. |
|
exclude |
Prevent validation if the value matches any value in the given array. Use this filter to exclude the default (usually first) option of a select input. |
|
equalto |
The value must match a value of another input. |
|
extension |
This filter is designed for file inputs. It supports multifile in HTML5 browsers. |
|