In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "what are the automatic verification properties of HTML5 forms". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope that this article "what are the automatic verification properties of HTML5 forms" can help you solve the problem.
In html5, while adding a large number of form elements and attributes, it also adds a large number of functions to verify the content validity of the form and the new elements in the form at the time of submission, so let's talk about automatic verification.
In html5, by using attributes on elements, you can perform automatic verification when the form is submitted. After performing the code, it will automatically verify whether the input is numeric or not when the form is submitted. If the verification fails, the question information text will be displayed.
1.required attribute
The new required attribute in html5 can be used on most input elements (except for hidden elements, on picture element buttons). If the content in the element is blank at the time of submission. The user is not allowed to submit, and the message prompt text is displayed in the browser, prompting the user to enter content in this element.
2.pattern attribute
New input elements, such as email,number,URL, require the input to conform to a certain format, use the pattern attribute for the input element, and set the attribute value to a regular expression in a certain format, and the content is checked to see if it conforms to the given format when submitted. When the input does not conform to the given format, submission is not allowed, and the information submission text is displayed in the browser. The submitted input must conform to the given format. The code is as follows, and the input is required to be 1 number and 3 uppercase letters.
3.min attribute and max attribute
The min and max attributes are specific to input elements of date type or numeric type, and they limit the range of numeric values and dates entered in the input element.
4.step attribute
The step attribute controls the steps when the value in the input element increases and then decreases. For example, when you want the user to enter a value between 0 and 100, but must be a multiple of 5, you can specify step of 5.
This is the end of the content about "what are the automatic validation properties of HTML5 forms". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.