1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resizing frame after email submit?

Discussion in 'HTML & JavaScript' started by ultimatium1, Dec 17, 2008.

  1. ultimatium1

    ultimatium1 Junior Member

    Joined:
    Oct 10, 2008
    Messages:
    107
    Likes Received:
    19
    Hey guys, I was just wondering, Isit possible to resize the frame after some1 has submitted their email? Seeing as the ifame is not located on your domain I dont think you can see inside the frame to detect wats been inserted inside the textfield.

    Im guessing soemthing could be done to detect the frame SRC and wen it changes it will resize the frame etc... Maybe some JS guru here can test it or has a script already

    Thanks for any help!
     
  2. downliner

    downliner Newbie Premium Member

    Joined:
    Mar 4, 2008
    Messages:
    26
    Likes Received:
    3
    Code:
    <html>
    <head>
    <script language="JavaScript" type="text/javascript">
    <!--
    function ReSize(id,h,src,tb){
     var obj=document.getElementById(id);
     obj.style.height=h+'px';
     obj.src=src;
     document.getElementById(tb).value='Height '+h+'px';
    }
    //-->
    </script>
    </head>
    <body>
    
    <input type="submit" value="submit" id="L1" onclick="ReSize('Tst',600,'http://www.yahoo.com','TB1');" /><br>
    
    <iframe id="Tst" src="http://www.google.com" width="500" height="200"></iframe>
    </body>
    
    </html>
    
    Copy and paste into Notepad. Save as "test.html" to your desktop to preview. Tested in IE6 and FF3 but obviously need to see your own code to know what you're trying to accomplish