In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what are the new form properties of html5". In the daily operation, I believe that many people have doubts about the new form properties of html5. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what are the new form properties of html5?" Next, please follow the editor to study!
The new html5 form properties are: autocomplete, novalidate, autofocus, form, formaction, formmethod, formnovalidate, formtarget, list, min, max, step, and so on.
The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.
HTML5's new form properties
Several new attributes have been added to the and tags of HTML5.
New attribute:
Autocomplete
Novalidate
New attribute:
Autocomplete: automatic completion, whether to automatically record previously submitted data for the next input proposal.
Autofocus: automatically gets the input focus.
Form: the value is the id of a form. If set, the input field can be placed outside the form.
Formaction: the URL address used to describe the form submission
Formenctype: describes the data encoding that the form is submitted to the server (only for method= "post" forms in form forms)
Formmethod: defines how the form is submitted.
Formnovalidate: describes that elements do not need to be validated when the form is submitted.
Formtarget: specify a name or keyword to indicate the display after the form submission data is received.
Height and width: specifies the image height and width of tags used for image types.
List: specifies the datalist of the input field. Datalist is a list of options for the input field.
Min and max: limit the minimum or maximum value of the input number
Multiple: whether multiple input values are allowed. If this attribute is declared, multiple values separated by commas are allowed in the input box.
Pattern (regexp): specifies a regular expression to validate the input. (regular default begins and ends with ^ $)
Placeholder: placeholder, used to display informative text in the input box, unlike value, cannot be submitted.
Required: validates input when the form is submitted, and pops up a prompt message if not.
Step: limits the step size of the input number, used with min.
Maxlength: limit the maximum length. It is useful only when there is input. There is no distinction between Chinese and English.
Minlength: the minimum length is limited, but it is not an H5 standard attribute and is only supported by some browsers.
Novalidate attribute
The novalidate property is a boolean (Boolean) attribute.
The novalidate attribute states that form or input fields should not be validated when the form is submitted.
Example: no need to validate submitted form data
E-mail:
Or autocomplete attribute
The autocomplete attribute states that the form or input domain should have autocomplete capabilities.
When the user starts typing in the autocomplete field, the browser should display the filled options in that field.
Tip: the autocomplete attribute may be turned on in the form element and off in the input element.
Note: autocomplete applies to tags, as well as the following types of tags: text, search, url, telephone, email, password, datepickers, range and color.
Example: enable autocomplete in form (disable autocomplete in an input field):
First name:
Last name:
E-mail:
Tip: in some browsers, you may need to enable autocomplete for this property to take effect.
Novalidate attribute
The novalidate property is a boolean (Boolean) attribute.
The novalidate attribute states that form or input fields should not be validated when the form is submitted.
Example: no need to validate submitted form data
E-mail:
Formaction attribute
The The formaction property is used to describe the URL address of the form submission.
The The formaction attribute overrides the action attribute in the element.
Note: the The formaction attribute is used for type= "submit" and type= "image".
Example: the following HTMLform form contains two submit buttons with different addresses:
First name:
Last name:
Formenctype attribute
The formenctype attribute describes the data encoding that the form submits to the server (only for method= "post" forms in form forms)
The formenctype attribute overrides the enctype attribute of the form element.
Primary: this attribute is used with type= "submit" and type= "image".
Example:
The first submit button is encoded to send form data by default, and the second submit button sends form data in "multipart/form-data" encoded format:
First name:
Formmethod attribute
The formmethod attribute defines how the form is submitted.
The formmethod attribute overrides the method attribute of the element.
Note: this attribute can be used with type= "submit" and type= "image".
Example: redefine the form submission method example:
First name:
Last name:
Formnovalidate attribute
The novalidate property is a boolean property.
The novalidate attribute describes that the element does not need to be validated when the form is submitted.
The formnovalidate attribute overrides the element's novalidate attribute.
Note: the formnovalidate attribute is used with type= "submit"
Example:
A form with two submit buttons (with and without validation):
E-mail:
At this point, the study on "what are the new form properties of html5" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.