I am trying to create a custom login page for my site, namely http://localhost/site/login, the problem I am running into now is that when the user tries to log in and enters the wrong username or password, they are redirected to the wp-login.php page, which is problematic, as you can imagine, so I would like to add AJAX form validation to my custom form, but the problem is that I am unsure of how to go about this the best way.
How can I validate a user using jQuery AJAX?
This is what I have thus far:
jQuery:
$('#selector').live('click', function(){
$.post('http://localhost/site/wp-login.php', { action: 'login' }, function(data){
console.log(data);
});
});
I do know that this is not the proper way of going about it, it is just to give you guys an idea of what I am trying to do. What would be the best way to achieve the desired effect?
Thanks in advance!