Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Member tim2788's Avatar
    Join Date
    Aug 2003
    Location
    North East England, UK
    Posts
    34
    Member #
    2909
    I'm not very familiar with Javascript but I have written a weblog script in php and I need to use Javascript for a 'smiley' feature which lets users add smiley faces to the text box exactly after the current pointer postion. (exactly like this forum). I would be grateful if somebody could show me how this is done.

    Thanks, Tim
    ----------------------------------------
    http://www.timothymerchant.co.uk

  2.  

  3. #2
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Code:
    <script>
    function setIT(face) {
     tarea = document.getElementById('t1');
     tarea.value += face + " ";
    }
    </script>
    <table>
     <tr>
      <td height=200 width=50>
       <table>
        <tr>
         <td><a href="#" onClick="setIT('=D'); return false"> happy </a></td>
        </tr><tr>
         <td><a href="#" onClick="setIT('=('); return false"> sad </a></td>
        </tr>
       </table>
      </td>
      <td height=200 width=450>
       <textarea cols=40 rows=7 id="t1"></textarea>
      </td>
     </tr>
    </table>
    Not perfect, but it works
    - Brian

  4. #3
    Member tim2788's Avatar
    Join Date
    Aug 2003
    Location
    North East England, UK
    Posts
    34
    Member #
    2909
    Ahh cheers. I'll play around with it.


    Tim
    ----------------------------------------
    http://www.timothymerchant.co.uk


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:38 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com