1

I am using jquery validate plugin to validate my form. Why I can't add a field named 'captcha-solution' and validate 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?

1 Answer 1

1

You can not use an object key with a -.

Try this...

'captcha-solution': "required", 

I wrapped the key in quotes.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.