I have a loading gif that appears on form submit. once it is finished, the page redirects to a php file so that it can do some things with the form inputs. My issue is that when I add in the URL for redirect in the success part of the function, the request is changed to GET and the form inputs are not passed through. With the code below, I can see the variables are being sent in the POST request (using firefox developer browser). But when I uncomment the location.href line once the submit is complete the post type changes to GET and I can no longer see the variables in the console request/headers. Can anyone point me in the right direction please?
Jquery/Ajax
$(function(){
var form = $('#date_range');
$(form).submit(function(e){
e.preventDefault();
$("#loader").show();
var fData = $(form).serialize();
var result = $.ajax({
type: 'POST',
url: 'test_loading_gif.php',
data: fData,
success: function(e){
$("#loader").hide();
//location.href = 'test_loading_gif.php';
}
});
});
});
$_GET.