Jump to content

Good ol smiley problem.


Grant132

Recommended Posts

Hey,

 

I've managed to get the str_replace etc. working for my guestbook from various tutorials. However i've been trying to find ways to make it so that when u push a button it will instantly insert the code etc. The only ways i've seen so far is some very messy js scripts. Is there a way to do in php or something else? or is JS the easiest way?

 

Cheers, Grant

Link to comment
https://forums.phpfreaks.com/topic/39733-good-ol-smiley-problem/
Share on other sites

I generally use

<script type="text/javascript" language="javascript">
function smilie(smilecode) {
document.FORM_NAME.TEXTAREA_NAME.value += smilecode;
}
</script>

 

Then to call on them, make a link like

 

<a href="#" onclick="smilie('    ')"><img src="URL/TO/IMAGE" alt="" /></a>

 

Hopefully thats not too messy :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.