Multi-line textbox scrolled to bottom?

D

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!
 
W

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 ([email protected], 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.
 
W

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 ([email protected], 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top