开发者

Issue of jquery validate

开发者 https://www.devze.com 2023-02-10 19:53 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消