jQuery验证-类列表 [英] Jquery Validate - List of Classes

查看:96
本文介绍了jQuery验证-类列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常愚蠢的问题,但是我正在寻找jquery表单验证器的内联验证规则列表.

This may be a very stupid question but i am looking for a list of the inline validation rules for the jquery form validator.

我知道我可以在此处找到 js函数:

I know that i can find the js functions here:

但是我正在寻找像这样的简单内联类的列表

but i am looking for a list of the simple inline classes like

电子邮件,URL,电话等,并学习如何使用它们.我只是在寻找一个简单的清单.谢谢.

email, url, phone, etc., and learn how to use them. I am just looking for a simple list. Thank you.

推荐答案

Looking at the source, I believe these are the only rules that can be used simply by adding classes:

  • 必填
  • 电子邮件
  • 网址
  • 日期
  • dateISO
  • 号码
  • 位数
  • 信用卡

关于如何使用它们,只需将它们添加到inputclass属性中即可:

As for how to use them, just add them into the class attribute of your input:

<input type='text' class='required creditcard' name='credit-card' />

您必须在传递给validate的对象中定义其他规则.

You'll have to define other rules in the object you pass to validate.

这篇关于jQuery验证-类列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆