Changing the size of a textarea box

18 August 2004   5 comments   Web development

https://www.peterbe.com/plog/blogitem-040818-1/textarea.html

Mind That Age!

This blog post is 13 years old! Most likely, its content is outdated. Especially if it's technical.

Powered by Fusion×

I often find that typing in text in some textarea boxes on webpages that the size of the box is too small and I wish I could expand its size like I can with a running GUI program like Notepad or XEmacs. Here is now my experimental attempt of solving that problem. I've only tried it in Firefox (Linux) and Konqueror (Linux) so far. It did not work in Konqueror :(

The obvious risk is that having controls like this will confuse newcomers; and you can't use excessive and intrusive text to explain what these controls do.

Obviously this needs to be couple with some sort of cookie feature so that the desired size is remembered; but that's not the issue here.

Have a play with it

Follow @peterbe on Twitter

Comments

Matt Schinckel
Well, it does work with IE 5.5 (Win).

I've tried (briefly) including this in my comment box, but I haven't yet got it to work. I'll alter it so it only expands the height of the text area, since the width increase would interfere with the site layout.

I might also try coming up with some icons that reflect a smaller/larger textbox, and place them to the right of the box.
Donius
Works wonderfully in IE6/WIN, FF1.0.6/WIN and SAFARI1.3/MACOSX. :) Kickass! Thanks!

((thieve theive thieve...))
shavonne
is it possible to rezise the text box on the event onload??
I mean think that from a xml we send 100 lines of text..And when the page opens we need all of them to be visible (without the scroll bar) how can we do it??

Thank you.
Bruno
It works on konqueror 3.5.4 :)
Nice script!
Anonymous
have
Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
Python inspect module 16 August 2004
Next:
People who really can't think in numbers 20 August 2004
Related by Keyword:
Never put external Javascript in the <head> 02 April 2013
The awesomest way possible to serve your static stuff in Django with Nginx 24 March 2010
Getting uploadify to work 17 July 2009
V8 < TraceMonkey < SquirrelFish 23 September 2008
The importance of checking in Firefox 07 July 2008
Related by Text:
Urwid - curses-based UI/widget library for Python 30 October 2004
wkhtmltopdf and font size shrinkage 10 September 2010
The Linux Cookbook 08 December 2003
Better select boxes for issue tracker 29 April 2005
A blog comment spam solution: Retalition! 31 July 2011