View Full Version : [SOLVED] Enable link/button when user scrolls to bottom of page (or element)

01-04-2012, 07:51 PM
I've been handed an html document that contains a centered, scrollable <iframe> element with a static height and width. This iframe element displays a simple html document that houses the 'terms of service' text.

Their goal is to have it to where the <a href> link at the bottom that is shown to the user as 'next' is disabled until the user scrolls to the bottom of the terms of agreement box.

The clickable link could be a button, image or text (no preference).

They have to have it this way for legal reasons and radio buttons or checkboxes will not suffice unfortunately.


What is the best way to go about doing this that seems to be cross-browser friendly (especially IE7).

I offer $10 via paypal for well commented method/script.

Philip M
01-04-2012, 08:12 PM
Have a look at:- http://www.tek-tips.com/viewthread.cfm?qid=1065669

The simplest way is to position Accept/Decline radio buttons at the end of the legal stuff. Why will that not suffice for you?

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

01-04-2012, 08:15 PM
It suffices for me, but not for them. I had offered that solution as well as one that says 'by clicking next, you agree to the above terms'. I believe they ran into legal issues the last time they used radio/checkbox buttons and made a blanket rule against using those methods.

I cannot get them to budge on this sadly.

I could amend the template to make everything fit onto a page without the need for a scrollable element but it does not look that great.

01-04-2012, 09:42 PM
if I forgo the 10 bucks can I skip the commenting bit?

<style type="text/css">
#div1 {word-wrap:break-word;
<script language="javascript">
function checkScrollPosition(elem) {
if(elem.scrollHeight<(elem.scrollTop+elem.offsetHeight)) {
document.getElementById('b2').disabled= false;
<p>Please Read</p><br />
<div id="div1" onscroll="checkScrollPosition(this)"><center>
<strong>Before we can allow you access to our Forum, you must read the rules as stated below.</strong>
1 Posting rules</font></b></p>
<li><b><font face="Verdana" size="2">1.1)</font></b> <font face="Verdana" size="2"> <b>Always be respectful and polite when posting</b>-
There is absolutely no excuse to be rude, confrontational, or hostile
when posting on CodingForums.com. This is a place where web programmers
come together to solve problems, not create them. Flaming can get you

<li><b><font face="Verdana" size="2">1.2)</font></b> <font face="Verdana" size="2"> <b>Do not crosspost-</b>
CodingForums.com is divided into various categories. When
initiating a thread, always locate the most appropriate category, and
post your question only <b><font color="#FF0000">ONCE</font></b>, in that category. Do not post the same
question in multiple categories.</font></li>
<li><b><font face="Verdana" size="2">1.3)</font></b> <font face="Verdana" size="2"> <b>No advertisements-</b>
CodingForums.com is not the
classified ads. Do not post advertisements/ self promotion/ spam of any
kind. Doing so will get you banned.</font></li>

<li><b><font face="Verdana" size="2">1.4)</font></b> <font face="Verdana" size="2"> <b>No
illegal requests-</b>
Do not post requests that are illegal or break the usage terms of the
service in question, such as where to download warez, disable pop up
ads on your free host etc.</font></li>
<li><font face="Verdana" size="2"><b>1.5) No homework assignments -</b>
Do not post
your entire homework assignment and request that other members do it for
you. This is considered cheating, and your thread may even be
used by your school to prove your guilt. Now, you may ask for advice or
help on a specific aspect of your assignment that you're having trouble
with. Use common sense as far as what's acceptable in terms of
soliciting help with homework assignments.</font></li>
<li><b><font face="Verdana" size="2">1.6)</font></b> <font face="Verdana" size="2"> <b>No objectionable content-</b> Do not post
content/subject/links that may not be appropriate to everybody,
including minors. Examples include adult links, hateful/ distasteful
content, vulgar language etc.</font></li>

<li><b><font face="Verdana" size="2">1.7)</font></b> <font face="Verdana" size="2"> <b>Stay on topic when initiating a thread or posting a
reply- </b>When replying to a thread, try and
stay true to the topic. This guideline is needed to prevent CodingForums.com
from becoming a chat room, and to maintain the quality of
information flowing through and stored. When future members stumble
across your post looking for answers, they will not appreciate chit
<li><b><font face="Verdana" size="2">1.8)</font></b> <b>
<font face="Verdana" size="2">Do not</font></b><font face="Verdana" size="2"><b>
empty your own thread unless for good reason - </b>Some members like to
go back and empty their own posts for whatever reason. This is highly
frowned upon and should not to done unless it's a matter of removing
sensitive or potentially harmful information (ie: to yourself). Emptying
your posts often destroys the rest of the thread, by creating
discontinuity and causing the rest of the conversation to become out of
context.</font><br />
<input type="button" id="b2" disabled="true" value="I agree, Activate my account" /></p>

01-04-2012, 10:10 PM
Excellent. That should do it. xelawho, if you wouldn't mind PM'ing me your email, I will take care of the rest.