Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to write to a document, not document's field?

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/showthre...&threadid=4211

    Hope this helps...

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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function writeIt(str) {
    var textNode = document.createTextNode(str);
    document.body.appendChild(textNode);
    }
    Hope that helps!

    Happy coding!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •