I am using jquery validate plugin to validate my form. Why I can't add a field named 'captcha-solution' and validat开发者_如何学运维e it? When I added this field,I got js error:
missing : after property id
captcha-solution: "required",
I am very confused.Can anybody tell my why?
You can not use an object key with a -
.
Try this...
'captcha-solution': "required",
I wrapped the key in quotes.
精彩评论