Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of html5 forms

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the new features of the html5 form", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the new features of the html5 form" this article.

The new features of html5 form are: 1, new input type type values (email, url, number, tel, color, date, etc.); 2, new form element attributes (placeholder, autofocus, form, min, max, patter, etc.).

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

The new features of H5 forms can be divided into two main categories.

Type values of one and 10 input

1. Email: Mail input field, which provides simple mailbox format verification when the form is submitted, and a prompt window pops up.

2. Url: address input field that provides simple URL address format verification when the form is submitted, and a prompt window pops up.

3. Number: digital input field. (min, max, step can be set)

4. Tel: the phone number input field, which pops up in the mobile phone browser.

5. Search: search the input field and display the search button in the lower right corner of the mobile browser.

6. Range: range selection control.

7. Color: color selection control.

8. Date/month/week: time selection control.

II. 11 new attributes of form elements

1. Autocomplete: automatic completion, whether to automatically record the previously submitted data for the next input proposal.

2. Placeholder: placeholder, which is used to display informative text in the input box. Unlike value, it cannot be submitted.

3. Autofocus: automatically get the input focus.

4. Multiple: whether multiple input values are allowed. If the attribute is declared, multiple values separated by commas are allowed in the input box.

5. Form: the value is the id of a form. If set, the input field can be placed outside the form.

6. Required: validates whether there is input when the form is submitted, and a prompt message pops up if not.

7. Maxlength: limit the maximum length, which is useful only when there is input. There is no distinction between Chinese and English.

Minlength: limit the minimum length, but it is not an H5 standard attribute and is only supported by some browsers.

8. Min: limit the minimum input number.

9. Max: limit the maximum value of input numbers.

10. Step: limit the step size of the input number, used with min.

11. Pattern: specify a regular expression to validate the input. (regular default begins and ends with ^ $)

These are all the contents of the article "what are the new features of html5 forms?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report