creando questa classe:
function InsertInField(modulo,fieldName){
this.modulo = document.forms[modulo]; // nome del mio modulo
this.fieldName = fieldName; // nome del textarea in cui verrà inserito il testo
this.fieldValue = document.forms[modulo].elements[fieldName].value;
this.showKeyboard = InsertInField_showKeyboard; // visualizza la tastiera
this.boldT = InsertInField_boldT;
this.underlineT = InsertInField_underlineT;
this.linkT = InsertInField_linkT;
this.br = InsertInField_br;
this.paragraph = InsertInField_paragraph;
this.list = InsertInField_list;
}
this.fieldName non mi da problemi, mentre this.fieldValue provoca questo messaggio di errore:
document.forms[modulo].elements[fieldName].value non è un'oggetto.
com'è possibile?![]()