I don't understand why you'd want to do it on load...why not just set it
right to begin with? Well, assuming you have your reasons, you have 2
problems with your code
[1] you arenn't passing a reference to your textarea, you are just passing
an id, try to change that to:
onLoad="SetNewSize(document.getElementById('Deskto pText_Div_ta'));">
[2] Since you are using styles to set the width and height, you'll want to
change the code to
textarea.style.width = '900px';
textarea.style.height = 'YYYpx';
Karl
"TJS" <no****@here.com> wrote in message
news:up**************@TK2MSFTNGP09.phx.gbl...
with the javascript, I think I would use the onload event, but it is not
working.
....
<script language="javascript">
function SetNewSize(textarea){
textarea.cols = 70;
textarea.rows = 10;
}
</script>
....
<body onLoad="SetNewSize('DesktopText_Div_ta')">
...
<textarea wrap="soft" id="DesktopText_Div_ta"
style="width='650px';height:'100%';display:block;B ackground-color:#ffffff">
...
"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl... Using javascript, yet..what events do you want to trigger this..here's
one that'll work on each keystroke:
<textarea name="x" onKeyUp="SetNewSize(this);" cols="5"
rows="4"></textarea> <script language="javascript">
function SetNewSize(textarea){
if (textarea.value.length > 5){
textarea.cols = 50;
textarea.rows = 50;
}else{
textarea.cols = 10;
textarea.rows = 15;
}
}
</script>
Karl
"TJS" <no****@here.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... can the rows and columns of a textarea element with an id be changed
on the fly ?
if so is there an example ?