Scrolling to the top of an iframe's parent on form submit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jagann2007
    New Member
    • Sep 2007
    • 1

    Scrolling to the top of an iframe's parent on form submit

    Hi all,

    I have a webpage with an IFRAME in it.

    But some of the pages on my IFRAME which has forms which are really long. So, I want a script or a html code whereby I can scroll to the top of the page once the user finishes with a certain page.

    Also, the IFRAME does not have a scroller, but the parent page does.

    So basically, putting my question more specifically, is it possible to use a submit button in the IFRAME to scroll to the top of the parent page (i.e, automatically scroll up with the parent page scroller) ?

    Also, do i have to put the code in the parent page code? or in the link which the IFRAME points to?

    Below is my code:
    [code=html]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>68 Classifieds</title>
    <meta name="Keywords" content="keywor ds, go, here" />
    <meta name="Descripti on" content="Your site description" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <base href="http://collectible.net/trufina/" />
    <link rel="stylesheet " href="templates/default/style.css" type="text/css" />
    <script type="text/JavaScript">

    <!--
    function MM_openBrWindow (theURL,winName ,features) { //v2.0
    window.open(the URL,winName,fea tures);
    }





    </script>
    </head>


    <body>





    <div id="wrapper">
    <!-- // Header // -->
    <div id="header"><a href="index.php "><img src="templates/default/images/header.gif" width="633" height="93" border="0" alt="68 Classifieds" /></a></div>
    <!-- // Header // -->
    <!-- // Top Bar // -->
    <div class="topbar">
    <div id="menu"><stro ng>

    </strong></div>
    </div>
    <!-- // Top Bar // -->


    <iframe src="http://qa.trufina.com/PartnerLogin/Login/3" id="myFrame" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0 "
    width="893" scrolling="no" height="1500" style="BORDER-RIGHT: black 0px solid; BORDER-TOP: black 0px solid; Z-INDEX: 999; LEFT: 20px; BORDER-LEFT: black 0px solid; BORDER-BOTTOM: black 0px solid; POSITION: absolute; TOP: 150px; LEFT: 54px; visibility:visi ble;">
    </iframe>

    .
    .
    .
    </div>

    </body></html>[/code]

    I am fairly new to the concept of IFRAMES, so any help would be grateful.

    Thanks.
    Last edited by pbmods; Sep 5 '07, 10:08 PM. Reason: Added CODE tags, removed about a million unnecessary and annoying <br>s
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    Originally posted by jagann2007
    Hi all,

    I have a webpage with an IFRAME in it.

    But some of the pages on my IFRAME which has forms which are really long. So, I want a script or a html code whereby I can scroll to the top of the page once the user finishes with a certain page.

    Also, the IFRAME does not have a scroller, but the parent page does.

    So basically, putting my question more specifically, is it possible to use a submit button in the IFRAME to scroll to the top of the parent page (i.e, automatically scroll up with the parent page scroller) ?

    Also, do i have to put the code in the parent page code? or in the link which the IFRAME points to?

    Below is my code:
    ...
    I am fairly new to the concept of IFRAMES, so any help would be grateful.

    Thanks.
    Well I have know idea what the problem is but I would like to point something out since your using XHTML.

    In XHTML every "tag" must be ended including empty tags in this case its your <br> tags. To end it you do this <br /> if you have any questions about XHTML go here its a tutorial on XHTML you should find every thing you need there.

    Thanks, Death
    Last edited by acoder; Sep 6 '07, 10:08 AM. Reason: removed code (causing bug)

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, Jagann. Welcome to TSDN!

      Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

      Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        See this link on iframes.

        Comment

        Working...