I was asked to implement resizing textbox based on content length in one of my projects, to avoid having to deal with scroll bars.And here is the code that works for me:<html><head><script>function textAreaResize(o) { o.style.height = "1px"; o.style.height = (25+o.scrollHeight)+"px";}</script></head><body><textarea id="textArea1" onkeyup="textAreaResize(this)" style="overflow:hidden"></textarea><asp:textbox id="txt1" runat="server" Width="500px" Height="25px"...
Friday, July 30, 2010
Resize Textbox/Textarea based on content length
Author: xiaoyu
| Posted at: 9:45 AM |
Filed Under:
.NET,
javascript
Subscribe to:
Posts (Atom)