我该怎么做表单验证,使用图标合格/不合格指标jQuery的? [英] How can I do form validation with jQuery using icons as pass/fail indicators?
问题描述
怎么做表单验证使用jQuery让一个绿色的对勾,如果一个字段传递一个正则表达式和一个红色的X如果失败?
How can I do form validation with jQuery to allow a green check mark if a field passes a regex and a red x if it fails?
任何人都可以点我到一些jQuery的,显示一个图标,立即如果一个字段验证和示例不同的一个,如果它失败?
Can anyone point me to an example of some jQuery that shows one icon immediately if a field validates and a different one if it fails?
推荐答案
还有的的jQuery验证插件支持之类的事情。看看在记住牛奶演示的形式;它具有即时反馈。你会设立了成功选项中的validate()方法做的不仅仅是提供负反馈。
There's the jQuery Validation plugin which supports that sort of thing. Take a look at the "Remember the Milk" demo form; it has immediate feedback. You'd set up the "success" option in the validate() method to do more than just provide negative feedback.
这篇关于我该怎么做表单验证,使用图标合格/不合格指标jQuery的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!