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
    Jun 2002
    Location
    Lincoln (UK)
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts

    adding information to text area - error

    I'm trying to add some content to a text area form element before the content of the text area.

    I can do it, so that the added content apears after the text area content but if I switch the script around I get an error.

    This works:
    Code:
    onClick="window.document.formmain.notes.value += 'add this'"
    But if I try this then the error occurs:
    Code:
    onClick="'add this' += window.document.formmain.notes.value"
    Any ideas?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    onclick="window.document.formmain.notes.value='add this'+window.document.formmain.notes.value"

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lincoln (UK)
    Posts
    138
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks John, that was starting to bug me.


  •  

    Posting Permissions

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