Solved

Check if textbox was read

Posted on 2015-01-09
1
86 Views
Last Modified: 2015-01-11
I have a textbox with terms and conditions.
i want to make sure my user actually scrolls through the text box.
How can I check to see if the scroll bar is at the same point as the height of the box?
0
Comment
Question by:rivkamak
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40540788
if you use jquery, you could do it like this:

jQuery(function($) {
    $('#txtBox').bind('scroll', function() {
        if($(this).scrollTop() + $(this).innerHeight() >= this.scrollHeight) {
            alert('end reached');
            //-- i would set a flag here so that when you submit your form, check the flag and if it's true, continue submitting
        }
    })
});

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question