By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

automatically scroll to bottom of textarea

P: n/a
Hello.

I've written this web application in asp.net and have a textarea what
I will use like a chat box. The box will be frequently refreshing. I
need the textarea to *automatically* scroll to the bottom or start at
the bottom displaying the last message sent. I am being told there is
no way to do this in asp.net and that I will have to do it in
javascript. Does anybody have any sample code on how to do this?

Many thanks for any help or information.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Credit for this goes to Yep from a response in July. IE.

John

<textarea id="textfield" rows="4">ajkldfkjasd

l;ajdf;lksdjaf

lajdfsl;jasd;lf

;lasdfj;ljasdf
</textarea>
<script type="text/javascript">
function f(ta_id){
var d=document, ta, rng;
if(d.all){
ta=d.all[ta_id];
if(ta && ta.createTextRange){
rng=ta.createTextRange();
rng.collapse(false);
rng.select();
}
}
}
f('textfield');
</script>

http://groups.google.com/groups?hl=e...ang.javascript

<ja***@cyberpine.com> wrote in message
news:ef**************************@posting.google.c om...
Hello.

I've written this web application in asp.net and have a textarea what
I will use like a chat box. The box will be frequently refreshing. I
need the textarea to *automatically* scroll to the bottom or start at
the bottom displaying the last message sent. I am being told there is
no way to do this in asp.net and that I will have to do it in
javascript. Does anybody have any sample code on how to do this?

Many thanks for any help or information.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.