jquery validation missing } after property list
I have this code here:
$("#order").validate({
rules: {
name: {
required: true
}
lastname: {
required: true
}
address: {
required: true
开发者_如何学Python }
telephone: {
required: true
digits: true
}
email: {
required: true
email: true
}
}
submitHandler: function (form) {
debug = true;
$(form).ajaxSubmit();
$("#thanks").show(1000);
$("#datadiv").hide(500);
}
});
and it throws "missing } after property list" error on firebug on line 4 in this code. And for the love of me, I can't figure out why - because I'm doing everything by jquery documentation.
You need to put commas in between properties of an object literal you are defining. For example:
name: { required: true }, // <-- note the comma
lastname: { required: true },
address: { required: true },
//etc
精彩评论