liam1412 Posted December 12, 2006 Share Posted December 12, 2006 Hican anyone point me in the direction of how I would go about creating the clickable smiley buttons that input the code for the smiley at the point where the curser is. Also the code and quote tag that wrap around the highlighted text. Posted this question on the PHP forum a couple of weeks and got told it was JS but had a look round and can't find anything. Not even in tht Javascript for complete numpties book i've got. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 12, 2006 Share Posted December 12, 2006 i dont know how to do it as well, having trouble myself, but I found this page:[url=http://www.createblog.com/forums/index.php?showtopic=51203]http://www.createblog.com/forums/index.php?showtopic=51203[/url]see how it works and maybe you can teach me afterwards (after you get how to do them)thanks :D! Quote Link to comment Share on other sites More sharing options...
liam1412 Posted December 12, 2006 Author Share Posted December 12, 2006 Ill have a look tonight when I get home from this hell hole of an office. I'll let you know tomorrow coz my internet is not working so i've just saved the page to my USB stick - They are the best invention ever!!! Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 12, 2006 Share Posted December 12, 2006 haha, yeah i like them as well, the modern ones you can store a few gbs, thats nearly the storage of a com :D Quote Link to comment Share on other sites More sharing options...
liam1412 Posted December 13, 2006 Author Share Posted December 13, 2006 Hi Ted_Chou12I got this off someone on another forum I use - Funnily enough the forum is completely unrelated to PHP. Just a technical section so i posted in there. Seems to make sense but I am at work so haven't tried it yet[quote]any ways, what your wanting is an onclick funciton set up for the images...set the images as links (a href) or as buttons (using css to make them images) and use the following as the href[code]"document.selection.createRange().text='::smilie::'"[/code]Example[code]<a href="document.selection.createRange().text='::smilie::'"><img src="smilie1.png"></a>[/code]this would then mean, when you click that button, it will execute the javascript link.. this is un tested, but that is the correct function... I will admit, i have never tried it in a href before, i have always used it in form buttons like this one.. [code]<input onclick="document.selection.createRange().text='textofsomesort'" type="button" value="button"><br>[/code]clicking the button will insert "textofsomesort" into the textbox where the cursor is..[/quote]Hope it helps. Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted December 14, 2006 Share Posted December 14, 2006 okay, thank you! I will try them right now. :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.