SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inserting text into textarea from button press

    Hi,

    I'm seeking some javascript code that I can use with a form button. When the button is pressed, some text is inserted into a textarea field. Just like on this forum.

    Anyone got an example on how this is done???

    TIA,

    Jeff Jensen
    nostromodk@hotmail.com

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <form>
    <textarea name="blah"></textarea>
    <input type="button" value="click here!" onClick="this.form.blah.value = 'woo\n\nwoo.'" />
    </form>
    ck :: bringing chris to the masses.


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
  •