View Full Version : Insert into textarea..
NB_DDRfan
08-13-2003, 12:39 PM
Where can I find a JavaScript that inserts stuff into a textarea? By this I mean, like the Smilies for this forum, you click it and it and code appears in the textarea. I want to do the same for my site's visitors who want to post things and format them.
Jon Hanlon
08-13-2003, 07:19 PM
<img id="smiley" src="smiley.gif" onclick="addText(':)')">
<img id="frown" src="frown.gif" onclick="addText(':(')">
<form name="myForm">
<textarea name="myText"> </textarea>
</form>
<script language="Javascript">
function addText(text) {
document.forms.myForm.myText.value += text;
}
</script>
NB_DDRfan
08-13-2003, 07:51 PM
yay! Thanks a ton! ^^
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.