Home All Groups Group Topic Archive Search About

Multi-line textbox scrolled to bottom?

Author
11 Jul 2006 12:46 PM
Dav
I need to enable a button when a multi-line textbox has been scrolled to the
bottom.   Can anyone tell me if it's possible to do this with client-side
script and/or server code?

Thanks!

Author
12 Jul 2006 9:28 AM
Walter Wang [MSFT]
Hi,

Thank you for your post.

I think you can use javascript to check the current scroll position of the
textarea (multi-line textbox):

<script language="javascript">
function check()
{
    form1.button1.disabled = !(form1.text1.scrollTop ==
(form1.text1.scrollHeight - form1.text1.clientHeight));
}
</script>

You do this check in the onscroll event of the textarea, you can set the
onscroll event in Page_Load:

text1.Attributes.Add("onscroll", "javascript:check();");

Hope this helps. Please feel free to post here if anything is unclear.

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Author
13 Jul 2006 2:00 PM
Dav
Worked like a charm!  Thank you!

Show quoteHide quote
"Walter Wang [MSFT]" wrote:

> Hi,
>
> Thank you for your post.
>
> I think you can use javascript to check the current scroll position of the
> textarea (multi-line textbox):
>
> <script language="javascript">
> function check()
> {
>     form1.button1.disabled = !(form1.text1.scrollTop ==
> (form1.text1.scrollHeight - form1.text1.clientHeight));
> }
> </script>
>
> You do this check in the onscroll event of the textarea, you can set the
> onscroll event in Page_Load:
>
> text1.Attributes.Add("onscroll", "javascript:check();");
>
> Hope this helps. Please feel free to post here if anything is unclear.
>
> Regards,
> Walter Wang (waw***@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
Author
14 Jul 2006 12:21 AM
Walter Wang [MSFT]
Hi,

Appreciate your update and response. I am glad to hear that the problem has
been fixed. If you have any other questions or concerns, please do not
hesitate to contact us. It is always our pleasure to be of assistance.

Have a nice day!

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.