Html/Javascript help please?

Andy

New member
I want a textarea and a button. When you click the button i want it to display the content of the textarea. I have this but there is a problem. When there is a large amount of text in the textarea most of the text goes out of the textarea! how can i fix it?

<script type="text/javascript">
<!--
function viewfi()
{
str = document.forms[0].area.value;
var popwindow=window.open("","","top=40,left=30
,width=500,height=125");

popwindow.document.open();
popwindow.document.write(str);
}
//-->
</script>
<form
<input type="button" onclick="viewfi()">
<textarea id="area" name="area" class="textarea"></textarea>
</form>
 
HTML is far too forgiving. Don't forget to close you form tag like this: <form>

The reason you can't see everything is because you gave the popup window a fixed size of 500x125. But if you want scrollbars to appear so that you can see the rest, after the height=125 add this within the quotation marks:

,scrollbars=yes
 
Back
Top