views:

561

answers:

1

I want to display a license agreement in a scrolling textarea and detect when the user has scrolled to the bottom of the text area, then enable the submit button. Is there a way to do that?

+1  A: 

Here's an implementation in javascript. The core functionality is:

function textareaAtEnd(area)
{
    return ((area.scrollTop + area.offsetHeight) > area.scrollHeight);
}
Stef