Skip to content

Rules (v1)

Use these rules as the second argument to bootstrapValidate(). Empty optional fields pass non-required rules in v2.3.0 and later.

min

Require a given minimum character count.

Since 1.0.0 1 option

min
bootstrapValidate('#input', 'min:20:Enter at least 20 characters!')

Open rule reference

max

Maximum character count required.

Since 1.0.0 1 option

max
bootstrapValidate('#input', 'max:42:Please dont enter more than 42 characters!')

Open rule reference

email

Require a valid E-Mail Address.

Since 1.0.3 0 options

email
bootstrapValidate('#input', 'email:Enter a valid email address')

Open rule reference

required

Require a field to be filled out.

Since 1.0.7 0 options

required
bootstrapValidate('#input', 'required:Please fill out this field!')

Open rule reference

url

Require a valid URL.

Since 1.0.10 0 options

url
bootstrapValidate('#input', 'url:Please enter a valid URL!')

Open rule reference

integer

Require a valid integer.

Since 1.0.10 0 options

integer
bootstrapValidate('#input', 'integer:Please fill out this input field!')

Open rule reference

numeric

Require a valid numeric input.

Since 1.0.10 0 options

numeric
bootstrapValidate('#input', 'numeric:Please only enter numeric characters!')

Open rule reference

alphanum

Require alphanumeric input, e.g. 0-9 and a-Z.

Since 1.0.10 0 options

alphanum
bootstrapValidate('#input', 'alphanum:Please only enter alphanumeric characters!')

Open rule reference

contains

Require the input to contain a given string.

Since 1.0.11 1 option

contains
bootstrapValidate('#input', 'contains:something:Your text needs to contain something!')

Open rule reference

startsWith

Require the input value to start with a given string.

Since 1.1.0 1 option

startsWith
bootstrapValidate('#input', 'startsWith:+49:Your phone number needs to start with +49')

Open rule reference

endsWith

Require the input value to end with a given string.

Since 1.1.0 1 option

endsWith
bootstrapValidate('#input', 'endsWith:UCV:Your Input needs to end with UCV')

Open rule reference

matches

Require the input value to match the given inputs value. Like bootstrapValidate's first Parameter, you can pass a selector or Element.

Since 1.1.0 1 option

matches
bootstrapValidate('#input', 'matches:#passwordConfirm:Your passwords should match')

Open rule reference

alpha

Validate only alphabetic characters - a-z, A-Z.

Since 1.1.0 0 options

alpha
bootstrapValidate('#input', 'alpha:You can only input alphabetic characters')

Open rule reference