Iam using the jQuery validate library to validate a form. For some reason it is erroring when I trying to add confirm-email. The error is Unexpected token -
The id is correct in the HTML.
var validation_options = {
focusInvalid: false,
rules: {
name: { required: true },
houseno: { required: true },
streetname: { required: true },
postcode: { required: true, postcodeUK: true },
country: { required: true },
phone: { required: true, validPhone: true },
email: { required: true, email: true, unique: true },
confirm-email: { required: true, equalTo: "#email" }
},
messages: {
name: "Please enter your name",
houseno: {
required: "Please enter your house number",
},
streetname: "Please enter your street name",
postcode: {
required: "Please enter your postcode",
postcodeUK: "Please enter a valid postcode"
},
country: "Please enter your country",
phone: {
required: "Please enter your mobile number",
validPhone: "Please enter a valid phone number"
},
email: {
required: "Please enter your email",
email: "Please enter a valid email address",
unique: "This email has already been used"
},
confirm-email: {
required: "Please enter your email"
}
},