I'm a bozo when it comes to Javascript so keep it simpe, ok? Using PHP I've coded a shoutbox for some people, and what they are wondering about is if it is possible that I make some smiley links next to the message field then when people click on it the required code of that respective smiley is placed into the post field is placed in the textbox, so that people (I'm talking about people who are not good with computers) don't have to remember all smiley codes. Do you have a simple script for me I could use for this purpose?
I don't have code, but it's really simply to do (trust me). <img src="smiley.png" onClick="document.getElementById('mytextbox').value += ''"/> If it's a textarea, use innerHTML instead of value. That's a REALLY simply way of doing it. It doesn't pay any attention to where the ibeam is, it simply adds it to the end. Now all you have to do is have a bunch of img tags. <img src="smiley.png" onClick="document.getElementById('mytextbox').value += ''"/> <img src="smiley2.png" onClick="document.getElementById('mytextbox').value += ''"/> I am assuming you are using PHP to replace and such with actual images, so I'll leave that to you. EDIT: The smiley graphics are actualy : ) and : ( [without spaces] because Digital Point is changing them.