我需要验证3个文本字段,并在字段上显示红色边框高亮显示,但是在输入所有3个字段之后,需要显示一个常见的错误消息。
我有三个文本字段:
<label>LABEL TEXT</label>
<input type="text" value="" size="2" maxlength="2" class="formInput" name="code1" />
<input type="text" value="" size="2" maxlength="2" class="formInput" name="code2" />
<input type="text" value="" size="2" maxlength="2" class="formInput" name="code3" />字段验证:
是强制字段
只有数字是允许的,确切的2个数字应该被允许。
客户端验证:
我需要应用验证在模糊和点击提交按钮,它将验证服务器端。
我需要以以下的方式应用验证--在第一个和第二个模糊的情况下,我需要突出显示无效条目的字段。但是,在模糊/输入所有三个字段中的数据后,显示一个常见的错误消息(标签将被错误消息替换)。
请提出问题,如果上面没有任何帮助,clear...any非常感谢。
发布于 2011-12-15 23:47:24
建议使用jquery验证器插件。阅读文档,你可以修改方法来做你喜欢做的事情。在这些论坛上有很多例子可以帮助你了解如何使用它。在网上也一样。
http://rocketsquared.com/wiki/Plugins/Validation#Validator
https://stackoverflow.com/questions/6458047
复制相似问题