PDA

View Full Version : print textarea


prenaud
08-29-03, 08:46 AM
Hi,

I'm using a script that prints the content of a textarea. I don't know how to deal with the paragraphs. The appear as long lines and only the beginning gets printed.

The print script is on this page:
http://fslactivities.sd61.bc.ca/editez/

I tried inserting HTML tags with pw.document.open("html"); and have the text appear in a table but that didn't work. Beside, I want to be able to print code as well.

Pierre

Here's the script.

function pt()
{
pw = window.open("","_blank","width=760,height=500,menubar=yes");
pw.document.open("text/plain");
pw.document.write(document.plaintext.message.value );
pw.document.close();
if(window.print){pw.print()}
else{pw.alert("Use the menu to print the page or CTRL-P")}
}

nd2
08-29-03, 08:58 PM
replace the new lnes with <br>, normal new lines have no value in html.

prenaud
08-29-03, 09:13 PM
Hi nd2,

I'm sorry but I don't understand what you want me to do. Did you have a look at the link?

Pierre