|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Multi-line textbox scrolled to bottom?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! 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. 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. > > 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.
Repeater and text boxes inside
how to change labelvalue when deleting row in gridview? How to put an image in a GridView Problem handling event in a button inside a Datalist Can't install iewebcontrols.msi - error "webctrl_client is unavailable" textfield not recognized in gridview menu control with XML file passing variable to sql statement in asp.net 2.0? creative scroll bar for asp.net Datagrids and User Controls |
|||||||||||||||||||||||