← Back to docs

Live Demos

Interactive examples for every built-in validation rule.

Fundamentals

Basic Form

Sign-up form covering required, email, minlength, and equalTo.

Rule

required

Ensures a field has a non-empty value after trimming whitespace.

Rule

email

Validates that the value is a properly formatted email address.

Rule

url

Validates that the value is a properly formatted URL.

Rule

date

Validates that the value can be parsed as a valid date.

Rule

dateISO

Validates ISO-like date format: YYYY-MM-DD or YYYY/MM/DD.

Rule

minlength / maxlength

Constrains the number of characters allowed in a field.

Rule

pattern

Validates a field against a regular expression.

Rule

equalTo

Confirms two fields have the same value (e.g. password confirmation).

Rule

numeric

Accepts only numeric digit characters (0–9).

Rule

range

Validates that a numeric value falls between a minimum and maximum using range: [min, max].

Rule

ipv4

Validates that the value is a properly formatted IPv4 address (e.g. 192.168.1.1).

Rule

ipv6

Validates that the value is a properly formatted IPv6 address (e.g. 2001:db8::1).

Rule

alphanumeric

Accepts only letters, digits, and underscores — no spaces or special characters.

Advanced

Custom Rules

Extend the validator with your own rules using addMethod().

Advanced

data-rule-* attributes

Declare rules directly in HTML using data-rule-* and data-msg-* attributes.