Web form text area
-
Hi, I'm trying to code a web based front end to a chatbot. I have something working that looks vaguely like MSN. I'm using a text area to display the chat, appending to it server side. How do I get the text area to always scroll to the end as it has no .select() function as in c#? Some javascript client side on page load to do this? Is there a text control I could use that supports multiple text colours? cheers for any help, Rob
-
Hi, I'm trying to code a web based front end to a chatbot. I have something working that looks vaguely like MSN. I'm using a text area to display the chat, appending to it server side. How do I get the text area to always scroll to the end as it has no .select() function as in c#? Some javascript client side on page load to do this? Is there a text control I could use that supports multiple text colours? cheers for any help, Rob
Hi Rob, You can have some client-side script that does the following:
var el = document.getElementById("TextBox1"); if (el) { el.focus(); el.innerText += ""; }
For your textarea this should place the caret at the end of the string in the control. You could run this in your onload event to automatically place it there everytime the page is (re)displayed. Hope this helps, Andy