← All demos

data-rule-* attributes

Rules and messages can be declared directly in HTML using data-rule-{rule}="value" and data-msg-{rule}="message" attributes — no JavaScript configuration needed.

data-rule-required data-rule-minlength="3" data-rule-maxlength="20"
data-rule-required data-rule-email="true"
data-rule-numeric="true" data-rule-minlength="5" data-rule-maxlength="5"