Skip to content
David edited this page Mar 6, 2015 · 9 revisions

Accepted

Checks to make sure the current field's checked attribute is set to true.

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

Accepted Parameters: None

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

Date Before

Checks to make sure the field's value, a date, came before the provided value.

How To Use: "my-fields-name-attribute": "dateBefore:03/06/2015"

Accepted Parameters: Date As A String (YYYY-MM-DD, MM/DD/YYYY, etc.)

Date After

Checks to make sure the field's value, a date, comes after the provided value.

How To Use: "my-fields-name-attribute": "dateAfter:03/06/2015"

Accepted Parameters: Date As A String (YYYY-MM-DD, MM/DD/YYYY, etc.)

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

Required If

Checks to make sure the field's, the one under validation, value is not null, undefined or false IF the field passed in as the first parameter equals the value passed in as the second parameter.

How To Use: `"my-fields-name-attribute": "requiredIf:my-second-fields-name-attribute:valueToTest"

Accepted Parameters: Another Field's Name Attribute and A Value To Test

Required If Not

Checks to make sure the field's, the one under validation, value is not null, undefined or false IF the field passed in as the first parameter DOES NOT equal the value passed in as the second parameter.

How To Use: `"my-fields-name-attribute": "requiredIfNot:my-second-fields-name-attribute:valueToTest"

Accepted Parameters: Another Field's Name Attribute and A Value To Test

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