The following code results in the following error:
SyntaxError: Unexpected token ).
Any ideas?
$("#signupForm").validate({
rules: {
'entry[first_name]': "required",
'answers[985575][answer]': "required",
'answers[985574][answer]': {
required: true,
phoneUS: true
},
'entry[email]': {
required: true,
email: true
}
}});
The
phoneUSis not a standard, built-in rule. So unless you have defined it, it won’t work. As explained in the documentation you need to define it. They provide the following method that you need to include in order to define thephoneUSrule:And here’s a working live demo.