This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Preview and confirmation pages within a frame


  1. denis
    Member

    Hi

    I just finished generating test forms which seems to work fine, but give me the annoying issue that they seem to break out of frames ? The way the site I'm working on was set, its main page calls sub section within a central frame. Bad design for sure, but I cannot change it right now, hence my forms are called in a frame below the site navigation. However apparently the confirmation page after a form submit seems to refresh the page and display the confirmation page only, by breaking out of the frame ? I tried adding a review page and it seems to do the same.
    Can this be avoided as it prevents me from using macform !
    Regards.

    Posted 15 years ago #
  2. yuniar

    Try this, edit your embed.php, go to line 45.
    Search for this code:

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

    replace it with this one:

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

    so instead of "top.location", you are using "parent.location" now.

    if you have "form review" enabled, you need to do the same modification to confirm_embed.php file as well.


    MachForm Founder

    Posted 15 years ago #
  3. denis
    Member

    Hi

    I have indeed replaced it in that page, and even wherever I found top.location it was replaced by parent.location, but still the final page breaks out of the frame !
    I wish I could change the page altogether but I cannot change the site for now, any idea what I missed ?

    Thanks.

    Posted 15 years ago #
  4. yuniar

    that's odd. can you let me know the URL to your page? So I can check it.
    If you don't want to post it here, please mail to: customer.service [at] appnitro.com


    MachForm Founder

    Posted 15 years ago #
  5. denis
    Member

    I emailed the infos, not sure if you got a chance to check it ? If that's useful I'll post any solution here later.
    Thanks.

    Posted 15 years ago #
  6. yuniar

    I've replied yesterday. Check your spam folder in case you didn't get it.

    Otherwise, please try to edit code between line 41 in "embed.php" file, from :

    header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id={$input_array['form_id']}&done=1");

    to become:

    $success = "http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id={$input_array['form_id']}&done=1";
    
    echo "<script type=\"text/javascript\">parent.location = '{$success}'</script>";

    MachForm Founder

    Posted 15 years ago #
  7. laurencelok
    Member

    Hi Yuniar,

    I am also having this problem. I made the two changes on lines 41 and 45 but the form still breaks out of the iframe: http://laurelcrown.com/xhtml-template/product_page_bug.htm (click on "Email this page" link in ready to order box).

    Is there anything else you told denis to make this work?

    Posted 15 years ago #
  8. laurencelok
    Member

    By the way, I am using an iframe called from a lightbox.

    Posted 15 years ago #
  9. yuniar

    If the code above doesn't work for some of you, try to change this code:

    parent.location

    into:

    self.location

    MachForm Founder

    Posted 15 years ago #
  10. hotchecks
    Member

    You can also try disabling javascript redirects when you create the embed form:


    <?php
    require("/home/machform.php");
    $mf_param['form_id'] = 1;
    $mf_param['base_path'] = '';
    $mf_param['use_header_redirect'] = 'false'; // this disables the javascript redirect
    display_machform($mf_param);
    ?>

    Posted 13 years ago #

RSS feed for this topic

Reply