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

auto height on iframe isn't working


  1. xstortionist
    Member

    This is what I did from Yuniar original post:

    <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>

    then my form is:

    <iframe width="100%" id="the_iframe"
    onload="calcHeight();"
    src="http://autowebspecials.com/infinitiwarranty/machform/embed.php?id=1"
    scrolling="NO"
    frameborder="0"
    height="1">
    An iframe capable browser is
    required to view this web site.
    </iframe>

    if you go to the site http://www.autowebspecials.com/infinitiwarranty/contact-us you will see that the javascript is there, but I just don't why it isn't working. I wish I had the answer to this mind boggling question.

    Yuniar can you please help me?

    Posted 14 years ago #
  2. yuniar

    Ah.. yes, quite simple actually. You are calling the form using "www.autowebspecials.com" domain, but your Javascript missed the "www" part:

    src="http://autowebspecials.com/infinitiwarranty/machform/embed.php?id=1"

    They are considered as different domains, thus it won't work.

    To fix it, adjust your javascript code to use the "www" domain.


    MachForm Founder

    Posted 14 years ago #
  3. xstortionist
    Member

    Yuniar, you are very good at what you do.

    Thank you for the support.

    Posted 14 years ago #

RSS feed for this topic

Reply