Home > Web Front-end > H5 Tutorial > HTML5 form (absolutely powerful function) usage example_html5 tutorial skills

HTML5 form (absolutely powerful function) usage example_html5 tutorial skills

WBOY
Release: 2016-05-16 15:49:29
Original
1363 people have browsed it

1. Automatic verification of email only requires type="email"
2. Verification of date (year, month, day): type="date"
3. Verification of time (format: 00:00): type= "time"
4. Verification of numbers (can be added up or down) type="number"
5. Month (--year--month) type="month"
6. Week ( --year--week) type="week"
7. range (range 0-100) type="range"
8. search type="search"
9. Color list: type="color"
10. URL verification (must be preceded by http://---) type="url"

Copy code
The code is as follows:


Email:

Date:
Time:

Number: < ;br/>
Month:

Week:

range:

search:

Color:




< option>Hey hey hey



url:
Username:

html new form attribute
1. required="required" is required for verification
2. placeholder="Please enter user name" Default value, What prompts the user is not what is submitted to the server
3. autofocus="autofocus" auto-focus function to improve user friendliness
4. pattern='w{5}' fill in the regular expression in the html element
Forms can also be submitted outside the form, but form="Myform" in needs to be equal to the value of the id in the form form, that is:

Auto-fill form: (The effect feels much better than the drop-down list and the effect is quite good) The value of the list must be equal to the value of the id in the datalist so that it can be recognized that I want to display your Content:

Copy code
The code is as follows:




< option>Hey hey hey



A sticker:
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template