Stretching a textarea's height

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Stretching a textarea's height

Post 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
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post 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.
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Post 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
Post Reply