#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    31
    Rep Power
    14

    javascript and textareas


    Hi,

    how would i make text go into a textarea useing javascript like the smilies on this forum?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    la, ca
    Posts
    84
    Rep Power
    14
    Not totally sure, but here's a way to add text to the textarea. This will add the words "blahblahblah" to the end of whatever's typed in the textarea each time the button's clicked.

    <script language="javascript" type="text/javascript">
    function addblahs(){
    document.formname.textareaname.value = document.formname.textareaname.value += "blahblahblah"
    }
    </script>

    <form name="formname">
    <textarea name="textareaname"></textarea>
    <input type="button" name="buttonname" value="click here" onClick="addblahs();">
    </form>

    So you should be able to add, instead of "blahblahblah", something like <img src="smily.gif">.

    Hope this helps.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    31
    Rep Power
    14
    k, ill just edit it for php and it will be what i wants, thx alot! ^_^

IMN logo majestic logo threadwatch logo seochat tools logo