本文介绍了增强jquery.validation(验证组)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好,我正在使用ASP.net,所以我使用下面的代码来做验证组。 http://fiddle.jshell.net/N5BYk/2/ [ ^ ] 现在我需要通过突出显示整个文本框和标签来增强验证,如果有错误,请参阅图像样本。 http://oi58.tinypic.com/iv8v3b.jpg [ ^ ] $ b $下面的b是我怎么做的代码(不包括在小提琴里面)。Hi all, im using ASP.net, so im using code as below to do the validation group.http://fiddle.jshell.net/N5BYk/2/[^]now i need to enhance the validation by highlight the whole textbox and label if there is an error, see the image for sample.http://oi58.tinypic.com/iv8v3b.jpg[^]below is the code how i do that (not included inside the fiddle).$("#form1").validate({ highlight: function (element) { $(element).closest('.form-group').removeClass('has-success').addClass('has-error'); }, unhighlight: function (element) { $(element).closest('.form-group').removeClass('has-error').addClass('has-success'); }, errorElement: 'span', errorClass: 'help-block', onsubmit: false, errorPlacement: function (error, element) { if (element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }); i尝试了几种方法,但仍然没有成功,任何人都可以建议我吗?i tried several ways, but still not success, anyone can advice me?推荐答案 i尝试了几种方式,但仍然没有成功,任何人都可以建议我吗?i tried several ways, but still not success, anyone can advice me? 这篇关于增强jquery.validation(验证组)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 03:09
查看更多