Setting iFrame to reload entire page, not just the frame

I am having a problem with how a form is embedded into a webpage. When the user submits the form, we have it set to redirect to a specific URL. However, when the page resets, it loads the entire page within the iframe and this would continue on into infinity if the form continued to be filled out and submitted. Is there a way to indicate that the form should not reload the entire page into the iframe? In words, to have the entire page start fresh so that the page itself does not reload into the frame of the iframe?

Hey @wrightda3,

From what I understand, you would like to redirect the parent page (the page that you’ve placed the iframe on) to another page. Please correct me if I misunderstood your question.

First, we’ll need to add an Additional CSS Class to the Design settings of the form. In my case, I’ll be adding a CSS class called ‘my-form’

And now, all you need to do is add the following to the JavaScript of the page.

var formClass = 'my-form'; // Make sure this is the same value as the class you added in step 1
var urlToGoTo = 'http://www.tadabase.io'; // Change this to the URL you want to redirect them to
var submitButtonLoaded = false;
function checkIfSubmitButtonHasLoaded() {
    if(submitButtonLoaded === false) {
        if ($('.'+formClass+' .form-submit button').html() !== undefined) {
            submitButtonLoaded = true;
        }
       window.setTimeout(checkIfSubmitButtonHasLoaded, 100);
    } else {
        $('.'+formClass+' .form-submit button').click(function(){
             window.top.location.href = urlToGoTo; 
        });
    }
}
checkIfSubmitButtonHasLoaded();

That’s all!