Welcome to “Algorithms and the Beauty of Programming” ↑ pay attention to us!
This article was first published on the wechat official account “Beauty of Algorithms and Programming”. Please follow us and learn more about this series of articles in time.
1. Background
(1) I believe that we will encounter the prompt information about form verification in the login website or registration information number, so, how to make the form verification with javascript about this prompt?
(2) When it comes to the verification, we are often associated with the error message after submitting the form, but in fact, the prompt message before filling in the form has a great relationship with the verification. This type of prompt can help users reduce the possibility of errors before filling out the form. There are a lot of sites that make it easier for users to type in the information before they fill it out. The common practice in China is to prompt you to input the format, such as Taobao, the address selection of the input format with a dark hint to tell the user can input Chinese pinyin and initials, clear and clear.
2 Related Codes
Here is my very simple form validation JS code: