Jump to content

Add smiley to textarea


smiles

Recommended Posts

I write some code, I know it lacks something but don't know what are they ?Could you show me them !!!Onclick smiley image then add ":)" to textarea

<html><body><script type="text/javascript">function emoticon(theSmilie){	doInsert(" " + theSmilie + " ", "", false);}</script><A href="java script:emoticon(':)')"><IMG alt=smilie src="smiley.gif" border=0></A><textarea rows="10" cols="30"> </textarea></body></html>

thanks !!!

Link to comment
Share on other sites

Use the below code instead:

<html><body><script type="text/javascript">function emoticon(theSmilie){	document.myForm.theText.value += theSmilie;}</script><A onClick="emoticon(':)')"><IMG alt="smilie" src="smiley.gif" border=0></A><form name="myForm"><textarea rows="10" cols="30" name="theText"> </textarea></form></body></html>

If that doesn't work, change .value to .text and try again. (If using Internet Explorer, close your document and re-open it. IE doesn't like refreshing local files.)

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...