T
TJS
can the rows and columns of a textarea element with an id be changed on the
fly ?
if so is there an example ?
fly ?
if so is there an example ?
Karl said: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('DesktopText_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
style="width='650px';height:'100%';display:block;Background-color:#ffffff">TJS said: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"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.