HTML

HTML FORM VALIDATION WITHOUT JAVASCRIPT

TEXT <input type="email"/> <input type="url"/>

RESTRICTED FILE TYPES

01

NUMBERS <input type="number"/>  <input type="range"/>

DATE-TIME <input type="date"/> <input type="time"/> <input type="datetime-local"/> <input type="week"/> <input type="month"/>

Required, 2 to 8 characters. <input type="text" required   minlength="2" maxlength="8"/>

FIELD RESTRICTIONS

02

Required, number from 1 to 12. <input type="number" required   min="1" max="12"/>

NUMBER FROM 0-10, IN STEPS OF 2. <input type="range" min="0" max="10" step="2"/>

Enter "Doge" or "Cate" <input type="text" pattern="Doge|Cate"/>  Enter "Doge" (Case Insensitive) <input type="text" pattern="[Dd][Oo][Gg][Ee]"/>

CUSTOM PATTERNS

03

Matches (0 to 9) 3 times  <input type="text" pattern="[0-9]{3}"/> Matches (0 to 9) 1 to 3 times <input type="text" pattern="[0-9]{1,3}"/>

Start with "T", followed by 3 characters, end with X  <input type="text" pattern="T.{3}X"/>