HTML5 verification and date display implementation

Source: Internet
Author: User

Comments: I used to ignore the powerful functions of HTML5. Anyone who knows that most of its data does not require self-verification or plug-ins to display calendars. Some small functions are shared with you.1. the Email input box automatically verifies the Email validity.

The Code is as follows:
<! Doctype html>
<Html>
<Body>
<Form action = "#" method = "get">
E-mail: <input type = "email" name = "user_email"/>

<Input type = "submit"/>
</Form>
</Body>
</Html>

2. Enter the number. The verification is correct. You can set the start digit.

The Code is as follows:
<! Doctype html>
<Html>
<Body>
<Form action = "#" method = "get">
<Input type = "number" step = "5" min = "5" max = "20" name = "number" value = "0"/>
<Input type = "submit"/>
</Form>
</Body>
</Html>

3. the URL input box can verify the validity of the URL input.
<Form action = "#" method = "get"> URL: <input type = "url" name = "user_email"/> <br/> <input type = "submit"/> </form>
4. Date pickers (date, month, week, time, datetime, datetime-local) Selection box, you can select Date, time, month, week.

The Code is as follows:
<! Doctype html>
<Html>
<Body>
<Form action = "#" method = "get">
Date: <input type = "date" name = "user_email"/>
Month: <input type = "month" name = "user_email"/>
Week: <input type = "week" name = "user_email"/>
Time: <input type = "time" name = "user_email"/>
Datetime: <input type = "datetime" name = "user_email"/>
Datetime-local: <input type = "datetime-local" name = "user_email"/>
<Input type = "submit"/>
</Form>
</Body>
</Html>

5. Select datalist input.

The Code is as follows:
<! Doctype html> <Body>
<Form action = "#" method = "get">
Webpage: <input type = "url" list = "url_list" value = "fdf" name = "user_email"/>
<Datalist id = "url_list">
<Option label = "W3School" value = "http://www.w3school.com.cn"/>
<Option label = "Microsoft" value = "http://www.microsoft.com"/>
</Datalist> <input type = "submit"/>
</Form>
</Body>
</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.