...

View Full Version : How to write to a document, not document's field?



bostjank
08-18-2002, 02:53 PM
Hi!

I use this script to write to a certain filed in a document that opened page with this script:

window.opener.document.forms[strForm].txtField.value=strValue;

Is there any way I could write the certein value directly to the document, not in the field? The problem is, tha i cannot format the text in the text field, so I need to format it using html in the document.

Thanks,
Bostjan:thumbsup:

redhead
08-18-2002, 03:21 PM
you could use document.write(strValue)... but it would be alot better to write it into the contents of a div... take a look at this thread:

http://www.codingforums.com/showthread.php?s=&threadid=4211

Hope this helps... :thumbsup:

edit:
The problem is, tha i cannot format the text in the text fieldyou can style your text box using CSS...

nolachrymose
08-18-2002, 06:22 PM
function writeIt(str) {
var textNode = document.createTextNode(str);
document.body.appendChild(textNode);
}

Hope that helps!

Happy coding! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum