SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Utah
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dynamically inserting text into textbox...

    I'm not very familiar with Javascript, only PHP and ASP. I want to be able to have a user click an image and have text be inserted into the textbox where the cursor is at.

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    document.forms['formname'].elements['textareaname'].value = 'whatever i really want to be honest';

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Utah
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Appending to what is in the textbox already...

    That doesn't add to what is already in the text box, how would I do that? Sorry, I don't know too much about javascript.

  4. #4
    SitePoint Zealot jonsteele's Avatar
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To append..

    document.forms['formname'].elements['textareaname'].value += 'whatever i really want to be honest';

  5. #5
    SitePoint Member
    Join Date
    Jun 2001
    Location
    Utah
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, but how can I have it insert the text at the point that the cursor is currently at? So that I have my article, click somewhere in the article where I need to add the text, and be able to click the button and it adds it at the spot in the article where I need it.

  6. #6
    SitePoint Zealot jonsteele's Avatar
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This recent thread provides a lead: http://www.sitepointforums.com/showt...threadid=71124


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
  •