Home >Web Front-end >JS Tutorial >jQuery form validation plug-in formValidation implements personalized error prompts_javascript skills
jQuery form validation plug-in formValidation implements personalized error prompts_javascript skills
WBOYOriginal
2016-05-16 18:51:011533browse
The rendering is as follows:
Instructions for use You need to use the jQuery library file and formValidation library file [Download the example code] http://jquery.com/ At the same time, you need to customize the CSS style that displays the error message
As shown in the above example, it is relatively simple to use the formValidation plug-in to implement the form verification method, mainly because of the personalized error prompts it implements. At the same time, the matching rules can be customized, as follows:
"telephone":{ "regex" :"/^[0-9-()] $/", "alertText":"* Invalid phone number"}, where regex represents the matching rule
so that you can use alertText to implement customized form errors Prompt text, this is the same as the use of the Validation plug-in. It is recommended to use the jQuery form validation plug-in formValidation to implement personalized error prompts. File package download
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn