Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i-frame and parent window scrollbar problem

Status
Not open for further replies.

robburne

Programmer
May 10, 2005
33
GB
Hi,

I posted a request for help solving this problem a while back, I now better understand the problem and so hopefully there is a solution out there.

I have an i-frame and within the i-frame is a html form.

The i-frame is taller than the screen, so in order to complete the html form the user has to scroll the main parent window (the i-frame has no scrollbar).

The problem is that once the form is submitted the user still can see the bottom of the i-frame on the posted to page. What I need to know is how can I force the parent windows scroll bar to return to the top when the form is submitted in the i-frame.

Hmmmm, any ideas please?

Rob.
 
This will be a shot in the dark:
Code:
<form ... onsubmit="window.parent.location.href = '#'; return true;">
 
Or you could use something like this:
Code:
<form onsubmit="window.scrollTo(0,0);">
 
I'll give a try and let you know.

Thanks,

Rob.
 
Hi guys,

I managed to get it working using a combination of the solutions offered above, this worked:

onsubmit="window.parent.scrollTo(0,0);"

Many thanks you really are stars!

Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top