Hello thanks for reading my question.
I had a working smile that worked similar to the one you see here with at list of smiles on the side of the text area. But I decided to make a pop up for more smiles and I created it and I can make the popup work with this code;
onclick=\"setForm('".$DSBBC1."')\"
However, when the smiles are listed next to the form I was using this code with the counter
$counter = " var counter = document.getElementById('{$textarea}counter'); if (counter) { counter.value=document.getElementById('{$textarea}').value.length; }";
and this with the onclick
onClick=\"emoticon(document.getElementById('{$textarea}'),'{$DSBBC1}'); $counter;\"
Where emoticon is
/**
* insert emotion item
*/
function emoticon( txtarea, text ) {
text = ' ' + text + ' ';
if (txtarea.createTextRange && txtarea.caretPos) {
var caretPos = txtarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
txtarea.focus();
} else {
txtarea.value += text;
txtarea.focus();
}
}
What I'd like to do is use emoticon() function in the popup because it seems to work well with the counter. Is this possible?
I guess it has to pass the data some how back to the calling page?