Grant132 Posted February 23, 2007 Share Posted February 23, 2007 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 More sharing options...
corbin Posted February 23, 2007 Share Posted February 23, 2007 Forms are client side, PHP is server side.... If the JS scripts are 'messy' I suggest you write your own. Link to comment https://forums.phpfreaks.com/topic/39733-good-ol-smiley-problem/#findComment-191852 Share on other sites More sharing options...
hdshngout Posted February 23, 2007 Share Posted February 23, 2007 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 Link to comment https://forums.phpfreaks.com/topic/39733-good-ol-smiley-problem/#findComment-191856 Share on other sites More sharing options...
Grant132 Posted February 23, 2007 Author Share Posted February 23, 2007 Corbin, i would like to try and write my own but unfortunatly i don't know js and i don't exactly have the time to learn it atm (yr 11 studies) so ill just try and find an easier option for now =D and Hdshngout...thankyou very much =D got it working now Link to comment https://forums.phpfreaks.com/topic/39733-good-ol-smiley-problem/#findComment-192030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.