Skip to content
David edited this page Jan 20, 2014 · 9 revisions

Accepted

Checks to make sure the field's value is of an accepted type. Accepted Types are "yes", "on", true and 1.

How To Use: "my-fields-name-attribute": "accepted"

Alpha

Checks to make sure the field's value only contains English alphabetical characters.

How To Use: "my-fields-name-attribute": "alpha"

Accepted Parameters: None

Alpha Dash

Checks to make sure the field's value only contains English alphabetical characters, underscores and hyphens.

How To Use: "my-fields-name-attribute": "alphaDash"

Accepted Parameters: None

Alpha Numeric

Checks to make sure the field's value only contains English alphabetical characters, underscores, hyphens and numerical values.

How To Use: "my-fields-name-attribute": "alphaNum"

Accepted Parameters: None

Between

Checks to make sure the field's value is of numerical type and it is between the two provided values; min and max.

How To Use: "my-fields-name-attribute": "between:12,30"

Accepted Parameters: Min, Max

Between Length

Checks to make sure the field's value length is between the two provided values; minLength and maxLength.

How To Use: "my-fields-name-attribute": "betweenLength:12,30"

Accepted Parameters: Min Length, Max Length

Contains

Checks to make sure the field's value is one of the provided values.

How To Use: "my-fields-name-attribute": "contains:foo,bar,baz,..."

Accepted Parameters: Comma Separated List Of Values

Different

Checks to make sure the field's value is different from another field's value; you supply the other field's name attribute.

How To Use: "my-fields-name-attribute": "different:another-fields-name-attribute"

Accepted Parameters: Another Field's Name Attribute

Digits Length

Checks to make sure the field's value is of numerical type and has the same length, character wise, as the supplied value.

How To Use: "my-fields-name-attribute": "digitsLength:10"

Accepted Parameters: Length

Digits Length Between

Checks to make sure the field's value is of numerical type and has a length, character wise, between the two supplied values; minLength and maxLength.

How To Use: "my-fields-name-attribute": "digitsLength:10,50"

Accepted Parameters: Min Length, Max Length

Email

Checks to make sure the field's value is a valid email address.

How To Use: "my-fields-name-attribute": "email"

Accepted Parameters: None

IPv4

Checks to make sure the field's value is a valid IPv4 address.

How To Use: "my-fields-name-attribute": "ipv4"

Accepted Parameters: None

Max

Checks to make sure the field's value is of numerical type and it is less than or equal to the value supplied.

How To Use: "my-fields-name-attribute": "max:10"

Accepted Parameters: Max

Max Length

Checks to make sure the field's value length is less than or equal to the provided value.

How To Use: "my-fields-name-attribute": "maxLength:10"

Accepted Parameters: Max Length

Min

Checks to make sure the field's value is of numerical type and it is greater than or equal to the value supplied.

How To Use: "my-fields-name-attribute": "min:10"

Accepted Parameters: Min

Min Length

Checks to make sure the field's value length is greater than or equal to the provided value.

How To Use: "my-fields-name-attribute": "minLength:10"

Accepted Parameters: Min Length

Not In

Checks to make sure the field's value is NOT one of the provided values.

How To Use: "my-fields-name-attribute": "notIn:foo,bar,baz,..."

Accepted Parameters: Comma Separated List Of Values

Number

Checks to make sure the field's value is of numerical type.

How To Use: "my-fields-name-attribute": "number"

Accepted Parameters: None

Required

Checks to make sure the field's value is not null, undefined or false.

How To Use: "my-fields-name-attribute": "required"

Accepted Parameters: None

Same

Checks to make sure the field's value is the same as another field's value; you supply the other field's name attribute.

How To Use: "my-fields-name-attribute": "same:another-fields-name-attribute"

Accepted Parameters: Another Field's Name Attribute

URL

Checks to make sure the field's value is a valid Uniform Resource Locator (URL).

How To Use: "my-fields-name-attribute": "url"

Accepted Parameters: None

Clone this wiki locally