Open New Window with Form Textarea Input

V

vunet.us

My function takes textarea text input and opens a new window with that
text in it. It is a common "Preview Description" functionality.
How can I modify doit() function, so text input in the new window is
displayed with new line breaks (new paragraphs) without too much
hassle?

<html><head>
<script>
function doit(form,descr){
onclick="cForm(this.form)"
win=window.open('','myWin','toolbars=0,width=150,height=110');
form.target='myWin';
form.action=''
win.document.write(descr);
return false;
}
</script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<form name="item_upload" method="post" ENCTYPE="multipart/form-data"
action="">
<textarea name="Description" id="Description" cols="5"
rows="5"></textarea>
<a
onclick="doit(document.item_upload,document.item_upload.Description.value);"
href="">[Do]</a>
</form>
</body></html>
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top