jQuery Ajax form submit, to call php login script
- by Stevie Jenowski
Thanks for checking out my problem... I'm having trouble submitting a login form via Ajax for a php script to run and return a new set of html items which will be replacing the HTML in #userlinks.... heres what I have so far
$("#login_form").submit(function() { return false; });
$('#login_button').click(function(event) {
$form = $(this).parent("form");
$.post($form.attr("action"), $form.serialize(), function(data){
$('#userlinks').html(data);
});
});
The php script checks for post data of username && password, yet all I'm getting is a page refresh and no changes. Nothing returns unless I turn login_button into a link and change the script a bit... Any help would be appreciated!