jQuery验证:如何将字段设为红色 [英] Jquery Validation: How to make fields red

查看:248
本文介绍了jQuery验证:如何将字段设为红色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery和jquery.validate.cs(jQuery验证插件1.8.0)来验证表单.现在,它在字段旁边显示一条消息:这是必填字段".

I am using jquery and jquery.validate.cs (jQuery Validation Plugin 1.8.0) to validate a form. Right now it displays a message next to a field saying : "This is a required field".

我还希望每个字段都变成红色.我该怎么办?谢谢!

I also want each field to turn red color. How would i do that? Thanks!

推荐答案

没有任何自定义配置,您可以执行以下操作:

Without any custom configuration, you can just do this:

select.error, textarea.error, input.error {
    color:#FF0000;
}

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