468,168 Members | 1,510 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

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:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <title>68 Classifieds</title>
  5. <meta name="Keywords" content="keywords, go, here" />
  6. <meta name="Description" content="Your site description" />
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8. <meta http-equiv="Content-Script-Type" content="text/javascript"> 
  9. <base href="http://collectible.net/trufina/" />
  10. <link rel="stylesheet" href="templates/default/style.css" type="text/css" />
  11.     <script type="text/JavaScript">
  12.  
  13.     <!--
  14.     function MM_openBrWindow(theURL,winName,features) { //v2.0
  15.       window.open(theURL,winName,features);
  16.     }
  17.  
  18.  
  19.  
  20.  
  21.  
  22.     </script>
  23. </head>
  24.  
  25.  
  26. <body>
  27.  
  28.  
  29.  
  30.  
  31.  
  32. <div id="wrapper">
  33.     <!-- // Header // -->
  34.     <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>
  35.         <!-- // Header // -->
  36.         <!-- // Top Bar // -->
  37.     <div class="topbar">
  38.             <div id="menu"><strong>
  39.  
  40.             </strong></div>
  41.     </div>
  42.     <!-- // Top Bar // -->
  43.  
  44.  
  45. <iframe  src="http://qa.trufina.com/PartnerLogin/Login/3" id="myFrame"  frameborder="0"  vspace="0"  hspace="0"  marginwidth="0"  marginheight="0"
  46.                   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:visible;">
  47.             </iframe>
  48.  
  49. .
  50. .
  51. .
  52. </div>
  53.  
  54. </body></html>
I am fairly new to the concept of IFRAMES, so any help would be grateful.

Thanks.
Sep 5 '07 #1
3 5666
Death Slaught
1,137 1GB
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
Sep 5 '07 #2
pbmods
5,821 Expert 4TB
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.
Sep 5 '07 #3
acoder
16,027 Expert Mod 8TB
See this link on iframes.
Sep 6 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by HolaGoogle | last post: by
2 posts views Thread by superfreaker | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.