Page 1 of 1

Shout box *smilies*

Posted: Sun May 22, 2005 4:30 pm
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

Posted: Sun May 22, 2005 4:32 pm
by Ambush Commander
This is client-side capibilities aka Javascript.

Posted: Sun May 22, 2005 4:33 pm
by Smackie
:? cant you do something like that in php though?

Posted: Sun May 22, 2005 4:37 pm
by John Cartwright
That would require a refresh :\

Posted: Sun May 22, 2005 5:34 pm
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>