smiles Posted March 20, 2007 Share Posted March 20, 2007 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 More sharing options...
iyeru42 Posted March 20, 2007 Share Posted March 20, 2007 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 More sharing options...
smiles Posted March 21, 2007 Author Share Posted March 21, 2007 It works perfectly, thanks so much Link to comment Share on other sites More sharing options...
smiles Posted April 17, 2007 Author Share Posted April 17, 2007 hi ! In case I click smiley symbol from smiley popup window, how can I add it to textarea ?need server script ? Link to comment Share on other sites More sharing options...
smiles Posted April 18, 2007 Author Share Posted April 18, 2007 hi I have just solved it <script type="text/javascript">function emoticon(theSmilie){ window.opener.document.myForm.theText.value += theSmilie;}</script> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now