Results 1 to 2 of 2

Thread: Adding contents of a textbox into a string in code output

  1. #1
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Adding contents of a textbox into a string in code output

    Hi all, I am using some code as below to write to a textarea box on my page

    Code:
        function AddnotificationComm1 (formObj)
        {
            document.getElementById("showCode2").value="Line  has failed, Jenbo have been informed and will attend on"
        }
    I have a text box on the page and I need to put its entry into the output within the code above!

    The textbox is called "Comm1Lineno" so my code would look something like this but with the correct syntax -

    Code:
        function AddnotificationComm1 (formObj)
        {
            document.getElementById("showCode2").value="Line "Comm1Lineno" has failed, Jenbo have been informed and will attend on"
        }
    "Comm1LineNo" is a text box in the notifications form.

    I am used to Vb and have tried a few things here but cant get it in.

    I appreciate your help with this - Many Thanks

    Rob

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try this:
    Code:
        function AddnotificationComm1 ()
        {
            document.getElementById("showCode2").value='Line "Comm1Lineno" has failed, Jenbo have been informed and will attend on';
        }
    I deleted your variable in the function.
    I changed your double quotes to single quotes on the values.
    I put a `;` at the end of the line
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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