我有一个与我的代码,我有一个特定的textarea
,我使用主.error
类和另一个.textAreaError
,放置错误框是我想要的但我不确定我将配置textarea错误加载在这个特定的框中。jQuery设置两个类的验证错误框
From a previous question我被给了以下jQuery行function(error, element) { error.appendTo(element.siblings("label")); }
,但我不确定如何将它应用到下面的代码中。
的jQuery:
jQuery(document).ready(function() {
//Home Validation
onfocusout: true,
$("#quote").validate({
rules:{
companyName:{
required: true,
url: true
}
}
});
HTML:
<div class="error textAreaError">Error Here</div>
这是无效的代码。你不能只拥有“对话:真实,”独自坐着。它是插件的一个可选参数,因此它需要与其他可选参数一起使用。另外,请仔细查看[代码**和注释**中对您的其他问题的接受答案](http://stackoverflow.com/a/10151646/594235)以获取完整答案。提示:'errorPlacement:' – Sparky 2012-04-17 23:05:32