PDA

View Full Version : textarea, javascript?


robsgaming
01-28-2003, 09:46 AM
I'm trying to figure out how to insert text into a textarea according to something you click such as an image.

For example, this is pretty much exactly what you see on a lot of forums.. I want to have smilies, and when you click them it will insert something. Like if they click a smilie, it will insert :) into the text box.

I have already looked at the code of a lot of forums, but still do not understand. Thanks in andvace for any help.

kdjoergensen
01-28-2003, 01:04 PM
<form name="areaholder">
<textarea name="myarea" rows=10 cols=40>
</textarea>
</form>

<a href="javascript:document.areaholder.myarea.value=':)'; return false">
<img src="smile1.gif"></a>

<a href="javascript:document.areaholder.myarea.value=':(';return false">
<img src="smile2.gif"></a>