Ich hab das ganze mal für ein ASP Guestbook programmiert (siehe
http://www25.brinkster.com/oppossom/viewentry.asp?ID=0 ) und hab mir den Code dazu auch nur geklaut, auf jeden Fall:
javascript
:
PHP-Code:
<script language="JavaScript" type="text/javascript">
<!--
function emoticon(text)
{
text = ' ' + text + ' ';
if (document.post.txtEintrag.createTextRange && document.post.txtEintrag.caretPos)
{
var caretPos = document.post.txtEintrag.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.txtEintrag.focus();
}
else
{
document.post.txtEintrag.value += text;
document.post.txtEintrag.focus();
}
}
</script>
dazu noch die URL zum aufrufen (hab ich jetz von ASP Code ein wenig umgebaut, musst du dir halt dann mit deiner Datenbank hinrichten):
Smiley1
ich hoffe das nützt dir was...
mfg Thomas