Forum Moderators: open
I'm working on an advanced hosting system bsed on PHP. But I need few JAVASCRIPT elements, which I couldn't greate myself.
Thing is... there is a shoutbox. Users should be able to add smileys from a table, by pressing on the smiley image. It would then add a text smiley code after the already written text in the message field.
I have set the smilies outside the form.
form "post"
target textbox "message"
what it should do is "OnClick add " :)" after the already written text in the textbox "message""
Thank you
Tomi
<a href="#" onclick="addSmileyCode(':-)');return false;"><span>:-)</span></a>
function addSmileyCode( smileyCode )
{
var msg = document.forms["post"].message;
msg.value = msg.value + smileyCode;
}
I think that's basically what you're looking for (but you probably want to add some error checking, etc.).