Trailing commas (,
) are illegal in JavaScript. When you do something like this:
rules: {
firstname: 'required',
lastname: 'required',
}
the JavaScript engine will think that },
is the next item in the rules
object.
You need to do something like this:
rules: {
firstname: 'required',
lastname: 'required' // <-- no comma at end
}
3
solved I’m having trouble validating my form for some reason the error messages do not appear when the forename or surname is not enterd