Hello,
I am using jQuery's validation plugin to validate a username. Somehow my json request data is invalid and I dont know why. Here is the code:
remote: {
url: "blablabla",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: '{"username":"' + function () { return $("#username").val() } + '"}'
}
When I check out the request, the json data looks like this:
{"username":"function () {
return $("#username").val();
}"}
Do you have any advice?