I'm using a jquery validation plugin as below
$( "#myform" ).validate({
rules: {
user.email: { //the dot causes an error
required: true,
email: true
}
}
});
I have a dot in the name of the user email input text field name and this causes an error. How do I escape this dot? It's not in a String so I can't use \\
The Html element looks like this
<input type="text" name="user.email"/>
This is the plugin I'm using
You cannot escape it, you must quote it, like this:
Truth is, it's a best practice to use double-quotes (NOT single-quotes!) for all keys even when you don't need the quotes. This is to uniform with JSON, which requires the double-quotes.