21 users online (0 members and 21 guests)  


  Results 1 to 3 of 3
  1. #1
    woodknut's Avatar
    Disabled

    Status
    Offline
    Join Date
    Dec 2003
    Posts
    32

    help with "string" value from object

    I would like to display text from an external *.js file function within a section on a page.

    External function in terms.js:
    function fillTextArea(){
    var terms;
    terms = "You will heed and obey";
    return terms;
    }

    Page code snippets:
    <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" onLoad="document.tForm.tc = fillTextArea();">
    <form name="tForm">
    ...
    <SCRIPT LANGUAGE="JavaScript1.2">document.write( document.tForm.tc )</script>
    ...


    I have been able to load <textarea name="tc"> successfully so I'm inclined to think I have an issue with "string value" vs "object".
    I have tried tc.value, etc to no avail. I've tried <span id="tc"> and failed also.
    I am obviously grasping at straws so any help would be appreciated.


    W.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Without knowing more about what your end goal is, wouldn't this work?
    Code:
    <SCRIPT LANGUAGE="JavaScript1.2">document.write( fillTextArea() )</script>
    If I have misunderstood, try posting some more code rather than the snippets.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    woodknut's Avatar
    Disabled

    Status
    Offline
    Join Date
    Dec 2003
    Posts
    32
    DOH!
    Right on the money, Dean.
    Thanks alot!

    I have an external *.js file with our "terms and conditions" loaded into a variable. Currently filling a textarea from it. Now I'm just trying to see if I could use that same code to display within a page as table data, rather than in a textarea box.

    W.



Tags for this Thread