hi, im using this code to insert smilies into a textarea
function insertThis(Lo, end) {
var div_string;
strSelection = document.selection.createRange().text
if (strSelection == "") {
insertAtCaret(eval("document.all."+Lo), end);
return;
}
document.selection.createRange().text = strSelection + end
return;
}
it is called over
<img src="images/smilies/standart/bigsmile.gif" onClick="insertThis('post', ':D')" />
postis the name of the textarea
2 problems ...
a) if the textbox is not selected it inserts smilies all over the page and deletes stuff
b) the insert script does not run on mac os x ... any idea?