ho generalizzato lo script in questo modo
codice:
<script type="text/javascript">

<!--
function AddToTextarea(TextareaID,TextToAdd,Titolo,TypeText)
{	
	if(TypeText !=""){
	var L = prompt(Titolo,"");
	if (L != "" || null) {TextToAdd= '<' + TypeText + '>' + L + '</' + TypeText + '>'}
	}
    var MyTextarea = document.getElementById(TextareaID);
    if (document.all)
    {
        MyTextarea.focus();
        var MyRange = document.selection.createRange();
        MyRange.colapse;
        MyRange.text = TextToAdd;
    }
    else if (MyTextarea.selectionEnd)
    {
        var MyLength = MyTextarea.textLength;
        var StartSelection = MyTextarea.selectionStart;
        var EndSelection = MyTextarea.selectionEnd;
        MyTextarea.value = MyTextarea.value.substring(0, StartSelection) + TextToAdd + MyTextarea.value.substring(EndSelection, MyLength);
    }
    else
    {
        MyTextarea.value += TextToAdd;
    }
}
per cui se ho una faccina da inserire farò cosi
codice:
[img]../loghi/smile_01.gif[/img]
domanda: è corretto lasciare alcune cose vuote come sopra? ci ho messo gli apici e basta.
se ho invece un testo da formattare farò cosi
codice:
<input type="button" name="bold" value="B" onclick="AddToTextarea('commento','','Inserisci il testo da fare in grassetto','strong')">
cosa ne pensate?