Results 1 to 3 of 3

Thread: JS: Buttons that add text to a textarea

  1. #1

    Thread Starter
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734

    JS: Buttons that add text to a textarea

    Sorta like how the smilies work on Vbf. You click it and "" appears in the textarea. How is this done?

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    window.textarea.innertext = ''

    you might need to use window.document instead im not to sure

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    You can also do it something like this:

    Code:
    <script type="text/javascript"><!--
    function insertSmilie(smilie) {
      document.forms['feedback'].comments.value = smilie;
      return false;
    }
    //--></script>
    
    <form id="feedback">
      <textarea id="comments"></textarea>
    </form>
    
    <a href="#" onclick="return insertSmilie(':)');">:)</a>

Posting Permissions

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



Click Here to Expand Forum to Full Width