Appnitro Software Forums » MachForm

Auto expand/adjustable iframe

(12 posts)

  1. Below is some javascript code that will automatically expand the iframes that we currently use to embed forms.

    (1) Paste The blow to the head

    <script language="JavaScript">
    <!--
    function calcHeight()
    {
    //find the height of the internal page
    var the_height=
    document.getElementById('the_iframe').contentWindow.
    document.body.scrollHeight;
    
    //change the height of the iframe
    document.getElementById('the_iframe').height=
    the_height;
    }
    //-->
    </script>

    (2)Paste the code below to the body and replace "your page here" with your url

    <iframe width="100%" id="the_iframe"
    onLoad="calcHeight();"
    src="your page here"
    scrolling="NO"
    frameborder="0"
    height="1">
    An iframe capable browser is
    required to view this web site.
    </iframe>
    Posted 3 months ago #
  2. The code above is provided by max taken from this thread:
    http://www.appnitro.com/forums/topic/auto-expanding-iframe-details-inside?replies=23

    Posted 3 months ago #
  3. isak
    Member

    When I use this technique, I get a one-line iframe. My source is an external website, but even when I use in internal website, I get the same one-line iframe. I saved the page as .php and even .html. But it does not work for me. Help?

    Posted 1 month ago #
  4. isak
    Member

    When I use the standard form code, the page does not refresh to the top of the page. So when a form is submitted, the review page appears blank to the viewer unless you scroll up. When you submit the review page, the window again appears blank unless you scroll to the top to see the success page.

    That's why I was trying to use the auto-expanding iframe.

    Posted 1 month ago #
  5. That's odd.
    If you already use the same internal website, the auto-expanding iframe should be working just fine.

    Can you let me know the URL of your page? I'll check.

    Posted 1 month ago #
  6. isak
    Member

    http://heritagetexas-members.com/formsTest/west-vertical.php

    Feel free to fill in the form to test it... I am still testing and developing the form.

    Posted 1 month ago #
  7. Ah.. I see that your form is coming from another domain:
    http://htp-photos.com/machform/view.php?id=1

    I don't think the auto-expanding script would work for different domain.
    It only work if the iframe source is coming from the same domain.

    Posted 1 month ago #
  8. isak
    Member

    Maybe... maybe not:

    http://htp-photos.com/machform/west-vertical.php

    Posted 1 month ago #
  9. I checked that page, but I don't see the javascript. Perhaps you forgot to put it there?

    Also, where do you plan to use the form?
    htp-photos.com or heritagetexas-members.com?

    If you plan to use the form into htp-photos.com, then I suggest to use the advanced form code instead. That would work best, no iframe being used and no additional auto-expanding script needed.

    Otherwise, if you need to use it for the other site, I'm afraid the auto-expanding won't work.

    Posted 1 month ago #
  10. isak
    Member

    Thanks... I need it on members site.

    Posted 1 month ago #
  11. I suggest to install separate machform for each site and then use the advanced form code. That would eliminate the whole problem.

    You need to purchase separate license though ;-)

    Posted 1 month ago #
  12. Okay, I have it working. Problem is I have four forms on the page. Now the other three don't show up.

    onLoad="calcHeight();" - It might have to do with this.

    Posted 2 weeks ago #

RSS feed for this topic

Reply

You must log in to post.