Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow [SOLVED] Enable link/button when user scrolls to bottom of page (or element)

    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.

    Question:

    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.
    Last edited by patrickalexson; 01-06-2012 at 05:20 PM. Reason: Question was answered - marking resolved

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    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.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,774
    Thanks
    55
    Thanked 518 Times in 515 Posts
    if I forgo the 10 bucks can I skip the commenting bit?

    Code:
    <html>
    <head>
    <style type="text/css">
    #div1 {word-wrap:break-word;
    		border-style:solid;
    		border-width:1;
    		overflow:auto;
    		width:600px;
    		height:100px;
    		}
    </style>
    <script language="javascript">
    function checkScrollPosition(elem) {
    if(elem.scrollHeight<(elem.scrollTop+elem.offsetHeight)) {
    document.getElementById('b2').disabled= false;
    	}
    }
    </script>
    </head>
    <body>
    <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>
    </center><br>
    1 Posting rules</font></b></p>
          <ul>
            <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
              banned.</font></li>
    
            <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
              chat.</font></li>
    		<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 />
    </ul>
    </div>
    <input type="button" id="b2" disabled="true" value="I agree, Activate my account" /></p>
    </html>

  • #5
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent. That should do it. xelawho, if you wouldn't mind PM'ing me your email, I will take care of the rest.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •