Skip to content
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': {
  filters: 'number range',
  data: {
    range: [1, 100]
  }
}
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' }
Clone this wiki locally