I use codeignitor. Following is the jquery code I use for login form validation.
$("#login_form").validate({
errorPlacement: function(error, element) { },// Disable error messages
debug:true,
rules: {
username:
{
required: true,
remote:
{
url: "http://localhost/my_site/index_page/validate_username_password",
type: "post",
data: {
password: function(){ return $("#password").val(); } //Password is sent alongside the username
}
}
},
password:{required:true}
},
highlight: function(username, errorClass)
{
$(username).fadeOut(function()
{
$(username).fadeIn();
});
},
submitHandler: function(form) // CALLED ON SUCCESSFUL VALIDATION
{
window.location.replace='http://localhost/my_site/index_page';
}
});
By this code, after success validation, I am expecting my page to get redirected to
http://localhost/my_site/index_page
but it is not.
I use codeignitor.