Results 1 to 4 of 4

Thread: click-content goes in textarea

  1. #1
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default click-content goes in textarea

    Hello im a newbie to javascript,
    but I cant find this anywhere, I am looking for a code so when you click a button the button will place something in my textarea box.

    I am using this for BBcode

    so an example.
    I click a picture and it places the bbcode into my html textarea box, can anyone help me! I think this is javascript?
    Hey new design new look, goto xudas for personal webdsign help.. (:

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    onClick="whatever.value += 'something';" or something similar to that.

    That's the basic idea behind it.

    You could just look at the script on a working page to get some idea how it works.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thankyou, ill try to look for a script that has that....

    so I have to give the textarea a value to so the onclick is sending it to the value.

    i think thats right, Thankyou!



    Is there a away anyone can post a script example, I have no clue!
    Last edited by insanemonkey; 09-23-2007 at 12:04 PM.
    Hey new design new look, goto xudas for personal webdsign help.. (:

  4. #4
    Join Date
    Oct 2005
    Posts
    255
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I found this but I was wondering if it is possible to make more input buttons do a onclick with different functions?


    Code:
    <html>
    <head>
    <script>
    function addtxt(input) {
    var obj=document.getElementById(input)
    obj.value+="blah test 123"
    }
    </script>
    </head>
    <body>
    <textarea id="textarea1"></textarea>
    <br><input type="button" value="Write blah blah" onclick="addtxt('textarea1')">
    </body>
    </html>
    Hey new design new look, goto xudas for personal webdsign help.. (:

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
  •