quiTech
asked on
Javascript to resize textarea
I am looking for a javascript that can resize a text area based on the size of a window.
Specifically, the textarea is inside a table like this:
<table width="100%">
<tr>
<td>stuff</td>
<td>more stuff</td>
<td><textarea name="mytextarea" cols="40" rows="5"></textarea></td>
<tr>
</table>
Right now, the "cols" parameter is hard coded to 40. I would like to dynamically change that to be relative to the size of the window. If anyone can share a javascript that does something like that, I would appreciate it.
Specifically, the textarea is inside a table like this:
<table width="100%">
<tr>
<td>stuff</td>
<td>more stuff</td>
<td><textarea name="mytextarea" cols="40" rows="5"></textarea></td>
<tr>
</table>
Right now, the "cols" parameter is hard coded to 40. I would like to dynamically change that to be relative to the size of the window. If anyone can share a javascript that does something like that, I would appreciate it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm glad that I could be one of those that helped. I'm glad that Zvonko posted and you split; his post is good and correct. I figured it needed to be more dynamic (i.e. calculated) so automatically switched to JavaScript but I would choose CSS over JavaScript if JavaScript wasn't required.
Thank you for the grade, the points and the fun question.
Thank you for the grade, the points and the fun question.
Thanks from me too.
ASKER