AV1611 Posted October 20, 2008 Share Posted October 20, 2008 1st, I know PHP and NOT JS! I have a shoutbox I wrote in php. It works great. when the user does : P for example they get . The bottom of the box is a textarea Below the shoutbox is a table with every smiley and code in a td cell. Now, the question. I want to make it so if you click a smily image below it shows up in the textarea above. No clue where to begin, but I 've seen similar before. Help, and be gentle Link to comment https://forums.phpfreaks.com/topic/129268-solved-not-sure-what-to-call-the-subject-p/ Share on other sites More sharing options...
F1Fan Posted October 20, 2008 Share Posted October 20, 2008 Could you add some of the code you already have? You can then use a function called by the onclick event that throws it in there. Link to comment https://forums.phpfreaks.com/topic/129268-solved-not-sure-what-to-call-the-subject-p/#findComment-670224 Share on other sites More sharing options...
AV1611 Posted October 20, 2008 Author Share Posted October 20, 2008 <form method="POST"> <textarea></textarea> <input type="submit" value="Shout!" /> </form> then at the bottom a simple table with <td><img.... /> :somecode: </td> and so on. The code and image are simple replace when the text is displayed. all posts are in database table, and all img name/code are in a table. that's it. Link to comment https://forums.phpfreaks.com/topic/129268-solved-not-sure-what-to-call-the-subject-p/#findComment-670238 Share on other sites More sharing options...
F1Fan Posted October 20, 2008 Share Posted October 20, 2008 <script type="text/javascript"> function insertSmiley(smiley){ var txtarea = document.getElementById('smileytext'); txtarea.value = txtarea.value+smiley; } </script> <!-- just modified this, sorry --> <form method="POST"> <textarea id="smileytext"></textarea> <input type="submit" value="Shout!" /> </form> then at the bottom a simple table with <td><img onclick="insertSmiley('');".... /> :somecode: </td> Try that, modifying it, of course. Link to comment https://forums.phpfreaks.com/topic/129268-solved-not-sure-what-to-call-the-subject-p/#findComment-670245 Share on other sites More sharing options...
AV1611 Posted October 20, 2008 Author Share Posted October 20, 2008 that is SOOOO cool... Link to comment https://forums.phpfreaks.com/topic/129268-solved-not-sure-what-to-call-the-subject-p/#findComment-670261 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.