Appnitro Software Forums » MachForm 2

Changing the url redirect's target


  1. Hi all,

    Just upgraded to version 2 - Looking great!

    I was wondering if it's possible to change the target on the url redirect after submitting a form.

    When a form is embedded in an iframe & set to display a text message on submission, the iframe will reload with the success message. The problem appears to be that when redirecting to a URL the target is set to _blank and so the page will load outside the iframe - is it possible to change this to _self or _parent, which would redirect to a page within the iframe rather than outside the frame?

    Keep up the good work yuniar. I've been working on a PayPal integration concept and would like to share it with all of the other MachForm users when completed - I just need to crack the target issue.

    All the best,

    Alasdair

    Posted 4 years ago #
  2. Hmm.. that's actually by design, to redirect the whole page.
    If you only need to redirect the content of iframe, edit your embed.php file.

    Search around line 44, replace this one:

    echo "<script type=\"text/javascript\">top.location = '{$submit_result['form_redirect']}'</script>";

    with this:

    echo "<script type=\"text/javascript\">parent.location = '{$submit_result['form_redirect']}'</script>";


    MachForm Founder

    Posted 4 years ago #
  3. Thanks Yuniar,

    Amazing support (as always) - version 2 is looking great btw

    All the best

    Posted 4 years ago #
  4. quick note: To make the thank you page open in the iframe use self.location

    Posted 2 years ago #
  5. JessDelAngel
    Member

    This is not working for me, please I need help... the iFrame is inside an iFrame in Facebook

    Posted 5 months ago #

RSS feed for this topic

Reply