My back-end validation only accepts 1 parameter: email
When I look at Firebug, I can see that the URL of the request sends 2 parameters:
https://example.com/rest/checkDupEmail?newEmail=myEmail%40myEmail.com&email=
Here is the validation code...
HTML:
<input type="textbox" name="newEmail" id="newEmail"/>
JS:
validator = $('#emailForm').validate({
rules: {
newEmail: {
required: true,
remote: {
url: '/rest/checkDupEmail',
data: { email: $('#newEmail').val()},
dataFilter: function(data) {
var json = JSON.parse(data);
console.log($('#newEmail').val());
console.log(data);
}
}
}
}
});
It's like its taking the HTML field I specify (newEmail) and sending it as a parameter?