Page 1 of 1

Stretching a textarea's height

Posted: Wed Nov 19, 2003 4:12 pm
by mchaggis
Hi,

I know that it is possible to make a textarea stretch to the whole width of a page by using css in the following fashion:

Code: Select all

<textarea rows="15" cols="15" name="textarea" style="width: 100%"><textarea>
But attempting style="width: 100%; height: 100%" doesn't seem to do anything?

Thus my question, does anyone know how and if it's possible to stretch a text area to fill a given space height wise?

Thanks in advance

Posted: Wed Nov 19, 2003 4:38 pm
by microthick
Well, using styles to make width and height 100% does work for Firebird and probably Netscape 7. : )

The only way I can think of making it work for IE would be to use JavaScript to get the innerWidth and innerHeight of the window, then using some fun calculation, guesstimate the number of rows to fill the height and document.write that to your textarea tag in the rows attribute.

This link:
http://forums.devshed.com/t91765/s.html

has some funky code that might get you started.

Posted: Wed Nov 19, 2003 4:56 pm
by mchaggis
nope, netscape 7.1 (under linux) doesn't seem to have much affect :(

Ta for the link tho.... seems to have some useful stuff