使用元素上的元数据通过 jQuery 验证插件将其验证为信用卡
我可以将元数据添加到输入的 html 中,以便 jQuery 验证插件将其验证为信用卡号吗?如何指定所有信用卡类型都可接受?
(类似于包含“数字”类来验证仅输入数字。)
我已经尝试过这个(在黑暗中拍摄):
<input class="title" creditcardtypes="all" creditcard="true" name="cc-number" maxlength="16">
Can I add metadata to an input's html so that the jQuery validation plugin will validate it as a credit card number? How do I specify that all credit card types are acceptable?
(Analogous to including the class "digits" to validate that only digits are input.)
I have tried this (shot in the dark):
<input class="title" creditcardtypes="all" creditcard="true" name="cc-number" maxlength="16">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 jquery 验证插件中使用信用卡规则而不是数字
you can use the creditcard rule in jquery validation plugin rather than digits