我已将我的代码上传到 js bin 并收到以下错误我不确定如何修复它们,但我认为这是由于我试图用来},
传递我的 id 值。
Line 7: required: true; --- Expected '}' to match '{' from line 6 and instead saw ';'.
Line 10: required: true; --- Expected '}' to match '{' from line 9 and instead saw ';'.
Line 12: }, --- Expected an identifier and instead saw '}'.
Line 13: errorPlacement: function(error, element) { --- Expected ')' and instead saw ':'.
Line 13: errorPlacement: function(error, element) { --- Missing semicolon.
Line 13: errorPlacement: function(error, element) { --- Missing name in function declaration.
Line 21: }); --- Expected '(end)' and instead saw '}'.
jQuery(document).ready(function() {
//Home Validation
$("#quote").validate({
onfocusout:true,
rules:{
companyName:{
required: true;
},
companyAddress:{
required: true;
},
},
errorPlacement: function(error, element) {
if(element.is("textarea")) {
error.appendTo(".textareaError");
}else{
error.appendTo(".error");
}
}
});
});