• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Force scrolling to the end of an IFRAME

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me explain my scenario.

The parent page contains a "I agree" checkbox and an IFrame. The Iframe loads a static HTML page with the different conditions that the user has to agree upon.

The requirement is to make sure that the user scrolls down to the botton of the IFrame, before he clicks on the 'I agree'. I dont find any event on the Iframe that could help me do this.

Any suggestions ?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either use an anchor:
http://www.w3.org/TR/REC-html40/struct/links.html#h-12.2.1

Or you can use JavaScript to position the page where you want it. I blogged about this the other day:
http://radio.javaranch.com/channel/pascarello/2005/01/09/1105293729000.html

Eric
 
Balan Raj
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is a way to scroll to the end. But is there a way to check if the user really scrolled all the way ?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't you put a check box all the way at the end?
 
Balan Raj
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric,
Thanks for the quick response.

I wish I could put the checkboxes at the end of the Iframe page. The problem here is that the contents of the Iframe are not part of my application. They are customizable and can vary by user.

One option might be to use some javascript to write a checkbox at the end of the Iframe content file. But I would be stuck if the user opts to use a PDF instead of a HTML for the Iframe.

Any thoughts ?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The script here might help:

http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

Eric
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic