0

I am trying to send a post request to infusionsoft to store the data and then based on a user choice of something redirect them to the proper page. For some reason the data is being sent but the form is not redirecting after?

The form looks something like this, but I removed alot of the fields...

<form id="infus_form" class="infusion-form" form method="POST" enctype="multipart/form-data">
    <input name="inf_form_xid" type="hidden" value="1f37" />
    <input name="inf_form_name" type="hidden" value="Free" />
    <input name="infusionsoft_version" type="hidden" value="1" />

my javascript / ajax call is this, with the proper ending for the url..

event.preventDefault();

$.ajax({
    type: "POST",
    data: $("#infus_form").serialize(),
    url: "https://xi309.infusionsoft.com<APP>",
    success: function(data) {
        alert("HERE");
        var val = parseInt($('input[type=radio]:checked')[0].value);
        var urls;
        if (val != 1089){
            urls = "/free-thankyou";
        } else {
            urls = "/create-review";
        }
        window.location = urls;
    }
});

Error:

Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

Tyler Roper
  • 21,445
  • 6
  • 33
  • 56
Ben
  • 1

0 Answers0