Html5 form validation

HTML5 Form includes HTML5 New Form ElementsHTML5 New FORM Attributes for Form Validation & better usability on touch devices.

Bạn đang xem: Html5 form validation

Using HTML5, we can create a form with built in validation (i.e. no javascript required). Earlier, we were using JAVASCRIPT to lớn control form validation. These form controls are meant for both Desktop, tablets and smart phones.

These Form Controls are also touch friendly.

HTML5 Form Features

HTML5 Form Elements, Attributes, and Input types
New Attributes autofocus, required, placeholder, autocomplete, pattern, minlength, readonly, các mục.
New Input Types number, gmail, tel, tìm kiếm, url, range, date, month, week, time, color, range
New Elements meter, progress, datadanh sách.

Xem thêm: Cách Mã Hóa File Php Bằng Zend Guard New 2021, Tổng Hợp Các Trang Mã Hóa

HTML5 Form includes more attributes for functionality in HTML5 Form. Exp autofocus, placeholder, required, autocomplete, pattern, list etc.

Here are all HTML5 form elements with examples and use.


novalidate attribute is used in khung tag khổng lồ disable HTML5 based Form validation. After using novalidate in form tag, required and type based validation will not work.

autofocus attribute focus on that single particular size control on page load. autofocus can be used only once in a single webpage. Make sure autofocus element is visible in viewport on page load.

placeholder attribute shows some hint in input control. Placeholder value will disappear on focus or keypress. Supported controls for placeholder are input đầu vào controls và textarea. The default color of placeholder is lightgray, i.e (#999).

đầu vào type number keypad on android( Samsung Galaxy cảnh báo 3)
đầu vào type number keypad on IOS( Iphone 6s)
input đầu vào type tin nhắn keypad on android( Samsung Galaxy Note 3)
input type tin nhắn keypad on IOS( Iphone 6s)
đầu vào type tel keypad on android( Samsung Galaxy lưu ý 3)