Hi,
I have a "Reset Password" form being validated by the jQuery Validation plugin. Everything works fine except that I can't get the "remote" part to work with Django. What I'm trying to do is to have remote send an ajax request to my Django backend to check that the "Old Password" is correct as part of validation.
What I'm not sure about is how to set up my url.py and views.py to return what jQuery.validation needs
Login is required, so there will be a request.user
My Code:
$("#changePassword").validate({
rules:
{
oldPassword:
{
required: true,
remote:
{
url: "profile/password/check/",
type: "post",
data:
{
oldPassword: function()
{
return $("#oldPassword").val();
}
}
}
},
newPassword: "required",
confirmPassword:
{
equalTo: "#newPassword"
}
}
});
Help is much appreciated, thank you :)