D
D
denism3002019-04-19 23:27:01
AJAX
denism300, 2019-04-19 23:27:01

Why is there a redirect to the main page after submitting the form with ajax?

I have a form,
send it like this:

$('#build-calc-steps-form').on('submit', function () {
    var fdata = $(this).serialize();            
    $.ajax({
        method: "POST",
        url: "wp-content/plugins/build-calc/build-calc-result.php",
        data: fdata,
        success: function(data) {
            console.log(data);
        }
    });
});

After processing, there is a redirect to the main
build-calc-result.php so far contains
echo '<pre>';
print_r($_POST);
echo '</pre>';

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question