Prevent redirect after form is submitted
You should post it with ajax, this will stop it from changing the page, and you will still get the information back.
$(function() { $('form').submit(function() { $.ajax({ type: 'POST', url: 'submit.php', data: { username: $(this).name.value, password: $(this).password.value } }); return false; }); })
$('#registerform').submit(function(e) { e.preventDefault(); $.ajax({ type: 'POST', url: 'submit.php', data: $(this).serialize(), beforeSend: //do something complete: //do something success: //do something for example if the request response is success play your animation... });})