客户端验证在任何项目都是不够的,因为 JavaScript 可以直接忽略,人们可以提交请求到服务器。 然而这并不意味着客户端验证都没必要了,很多时候我们需要在用户提交到服务器之前给予提示。JavaScript 表单验证库允许开发人员自定义样式、错误消息和样式以及简化验证规则的创建。

  在本文中,您将找到最好的15个 JavaScript 表单验证库,可以帮助你让表单验证对用户更友好的和美观。

您可能感兴趣的相关文章
  • 网站开发中很有用的 jQuery 效果【附源码】
  • 分享35个让人惊讶的 CSS3 动画效果演示
  • 十分惊艳的8个 HTML5 & JavaScript 特效
  • Web 开发中很实用的10个效果【源码下载】
  • 12款经典的白富美型 jQuery 图片轮播插件

1. ApproveJS


ApproveJs doesn’t automatically attach itself to input change events or form submit events. It also doesn’t manipulate the DOM for you by automatically displaying errors. This allows you to handle validation how you want. ApproveJs exposes a single method, value() and leaves you to decide when a value is validated and how errors are displayed. If you like to be in control or have a little OCD like me, ApproveJs is for you.

2. Validator.js


validator.js is a library of string validators and sanitizers. It can be used both on client side and server side.

3. Valid.js


Valid.js is a simple JavaScript library for data validation. Here are validation functions.

• String : isString, minLength(min), maxLength(max), length(min, max), regex(reg)
• Number: isNumber, minNumber, maxNumber, between
• Date: isDate, minDate(min), maxDate(max), between(min, max)
• Bool: isTrue, isFalse
• Util: isRequired, isEmail, isCep

4. Validate.js


Validate.js provides a declarative way of validating JavaScript objects. It is unit tested with 100% code coverage and can be considered fit for production. The goal of validate.js is to provide a cross framework and cross language way of validating data. The validation constraints can be declared in JSON and shared between clients and the server.

5. jQuery.mobilePhoneNumber


jQuery.mobilePhoneNumber is a general purpose library for validating and formatting mobile phone numbers.

6. xTypejs


xtype.js is an elegant, highly efficient data validation for JavaScript. it provides concise, performant, readable, data and type validation for JavaScript, using close to 40 highly efficient, data-validating pseudo types.

It Improves application efficiency and readability by unifying the most basic but common data and type validations in JavaScript apps, into single, concise, highly optimized operations.

And employs bitwise operations, data pre-processing, and memory-efficient memoization for fast, robust performance in small and large apps and libraries.

7. Payform


Payform is a JavaScript library for building credit card forms, validating inputs, and formatting numbers. This library also includes a jQuery plugin.

8. Mailcheck


mailcheck is a JavaScript library and jQuery plugin that suggests a right domain when your users misspell it in an email address. When your user types in “user@hotnail.con”, Mailcheck will suggest “user@hotmail.com”.

9. Formance.js


A jQuery library for formatting and validating form fields, based on Stripe’s jQuery.payment library. It supports various fields like credit card cvc, credit card expiry, credit card number, email address, date, number, Ontario driver’s license number and much more.

10. Verify.js


Verify.js is a powerful, customizable asynchronous form validation library. It is fully customizable, easily extendable, unobtrusive, and includes grouped validations as well as asynchronous validations.

11. Seahorse


Seahorse is a JavaScript library, licensed as free software, created to simplify the use of forms, particularly to simplify the form validation. It provides functions to validate convert and serialize information and functions to assign real-time validation behaviors to form fields. It can be used with any JavaScript framework, however, has a plugin to be used along with jQuery.

12. Parsleyjs


Parsley is a JavaScript form validation library. It helps you provide your users with feedback on their form submission before sending it to your server. It saves you bandwidth, server load and it saves time for your users.
JavaScript form validation is not necessary, and if used, it does not replace strong backend server validation.

That’s why Parsley is here: to let you define your general form validation, implement it on the backend side, and simply port it frontend-side, with maximum respect to user experience best practices.

13. Form Validation Made Easy


The Form Validation – made easy script allows you to very easily set up validation rules and validate these rules against any sort of input coming from any type of array data source such as $_POST, $_GET or a key/value filled array.

The script can with ease be plugged in with existing HTML form code without drastically changing the HTML code. Or be implemented from scratch. The script also handles the population of input values for input fields, textareas, checkboxes, radio buttons and select lists if a default value has been specified and when a form is posted and returned to the user. This means the user never has to type in the same information twice when a form is invalid!

The script comes with a bunch of predefined rules but how you want to validate each and every input in your form is all up to you. With custom functions you are able to hook up with the script and supply your own validation rules and error messages.

14. JavaScript Form Validation Library


This is a complete library to validate client-side input and provide feedback accordingly. The JavaScript library contains 12 base validation functions that can validate all types of form fields. This library includes simple integration, visual feedback, range check, textual feedback, check minimum length, value retrieval, check date format, validate email, validate URL and much more.

15. Easy to Setup Form Validator JavaScript


The JS Auto Form Validator is an easy-to-setup form validation script which enables you to handle the whole form validation process using the ready-to-use JavaScript class. This script allows you to specify certain form elements as “required” or “non-required” and also a specific type they have: text, password, numeric, zip code etc. It works on the native JavaScript, meaning page will be loaded much faster – especially on mobile devices – as NO jQuery is needed!

您可能感兴趣的相关文章
  • Web 开发中很实用的10个效果【附源码下载】
  • 精心挑选的优秀jQuery Ajax分页插件和教程
  • 12个让人惊叹的的创意的 404 错误页面设计
  • 让网站动起来!12款优秀的 jQuery 动画插件
  • 8个非常惊艳的 HTML5 和 JavaScript 特效

本文链接:前端工具集 - 15个最佳的 JavaScript 表单验证库

编译来源:梦想天空 ◆ 关注前端开发技术 ◆ 分享网页设计资源

转载于:https://www.cnblogs.com/lhb25/p/best-javascript-form-validation-librarie.html

前端工具 - 15个最佳的 JavaScript 表单验证库相关推荐

  1. 15个最佳的 JavaScript 表单验证库

    客户端验证在任何项目都是不够的,因为 JavaScript 可以直接忽略,人们可以提交请求到服务器. 然而这并不意味着客户端验证都没必要了,很多时候我们需要在用户提交到服务器之前给予提示.JavaSc ...

  2. 15个非常实用的JavaScript表单验证库

    来源:web前端开发 https://mp.weixin.qq.com/s/p9s9cmAt2MZeCgmD2LC5Sg 客户端验证在任何项目都是不可缺少的,很多时候我们需要在用户提交到服务器之前给予 ...

  3. 10个强大的Javascript表单验证插件推荐

    创建一个JavaScript表单验证插件,可以说是一个繁琐的过程,涉及到初期设计.开发与测试等等环节.实际上一个优秀的程序员不仅是技术高手,也应该是善假于外物的.本文介绍了10个不错的JavaScri ...

  4. javascript 表单验证大全(一)

    javascript 表单验证大全(一) 5.身份证验证:包括15位和18位.function idNumber(s)//身份证验证 {regu1=/^[1-9]\d{7}((0\d)|(1[0-2] ...

  5. html表单验证js代码,JavaScript表单验证实现代码

    JavaScript 可用来在数据被送往服务器前对 HTML 表单中的这些输入数据进行验证 JavaScript 表单验证 JavaScript 可用来在数据被送往服务器前对 HTML 表单中的这些输 ...

  6. html自动验证邮件地址格式,JavaScript表单验证和邮箱格式验证的方法

    JavaScript 表单验证 JavaScript 可用来在数据被送往服务器前对 HTML 表单中的这些输入数据进行验证. 被 JavaScript 验证的这些典型的表单数据有: 用户是否已填写表单 ...

  7. HTML通过JavaScript表单验证

    HTML通过JavaScript表单验证 用户在填写表单的时候,我们程序对其进行验证是必须的,随便举个例子: <!DOCTYPE html> <html lang="en& ...

  8. 注册表单校验 js java,JavaScript表单验证完美代码

    用原生JS写一个简单的表单验证 首先,是html部分 新用户注册 基本信息 用户名: 请输入至少3位的用户名 密码: 请输入4到8位的密码 确认密码: 请再输入一遍密码 手机号码: 请输入11位手机号 ...

  9. react hooks使用_我如何使用React Hooks在约100行代码中构建异步表单验证库

    react hooks使用 by Austin Malerba 奥斯汀·马勒巴(Austin Malerba) 我如何使用React Hooks在约100行代码中构建异步表单验证库 (How I bu ...

  10. javascript表单验证及正则表达式

    1.表单验证的场景与意义 1.1.降低服务器压力 拦截不合格数据,避免直接提交到服务器,可以显著降低服务器开销 1.2.提升用户体验 早期的互联网,表单项非常多,注册账号需要填写20+字段.而其中有一 ...

最新文章

  1. oracle 11g 逻辑备库,通过Oracle 11g 逻辑standby实现BI的需求
  2. 利用runtime实现KVO
  3. 【洛谷 P3975】 [TJOI2015]弦论(后缀自动机)
  4. 成功解决Eclipse窗口布局混乱或者Eclipse窗口布局出现单独独立小窗口的问题(图文教程)
  5. 深入理解Java中的抽象类和接口
  6. android gradle错误,Android studio gradle错误与顶级异常
  7. 异常:org.springframework.http.converter.HttpMessageNotReadableException
  8. 【官方】下载最新adb及安装驱动的方法
  9. android studio简单的密码日记本,实现增删改查功能
  10. kotlin数组和集合
  11. 服务器虚拟网卡驱动卸载,Win10安装和卸载万能网卡版驱动的方法
  12. hexo+next主题优化之加入网易云音乐、网易云跟帖、炫酷动态背景
  13. python输入个人所得税计算_Python实现的个人所得税计算器示例
  14. Android 在PreferenceActivity 中移除一个Preference
  15. 1.2.2-凑零钱问题(暴力递归+动态规划)
  16. 文言文的理解 —— 字词篇
  17. 使用VLC组播测试及VLC收不到UDP组播数据
  18. 基于PMOS的过压保护(OVP)电路仿真
  19. RapidMiner 5.3.015源代码下载并且正确的运行
  20. 天猫淘宝成农产品销售主阵地,占市场份额75%,是拼多多43倍

热门文章

  1. 小白记事本--链表--loading
  2. java中什么是线程安全_Java 多线程:什么是线程安全性
  3. 享元模式在 Java Integer 中的应用
  4. flume流程之taildir-memory-hdfs
  5. lua_shared_dict的incr方法
  6. kafka 幂等机制入门实例
  7. hive时间函数入门
  8. Linux开发_GDB_dump_Core调试
  9. 9.2. FreeSWITCH
  10. ReactNative入门 —— 动画篇(下)