Shout box *smilies*

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Shout box *smilies*

Post by Smackie »

Can someone show me a tutorial or something on making a user friendly where users can just click on a smilie and it adds it to a text box on the shout page?

Thank you
Smackie
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

This is client-side capibilities aka Javascript.
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

:? cant you do something like that in php though?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

That would require a refresh :\
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

Indeed. If you don't want to do javascript, I know how you feel. This is how I've got it:

Code: Select all

function smilie(name) {
  document.foo.bar.value += ':'+name+':';
}

Code: Select all

<form name=&quote;foo&quote;>
<a href=&quote;#&quote; onclick=&quote;smilie('grin');return false;&quote;><img src=&quote;grin.gif&quote; alt=&quote;:grin:&quote; /></a>
<textarea name=&quote;bar&quote;></textarea>
</form>
Post Reply