Ciao a tutti, uso il seguente codice per inserire dinamicamente una SELECT con varie OPTION su una pagina html...

Codice PHP:
function add_me() 

    if(
document.createElement && document.getElementById && document.getElementsByTagName
    { 
        var 
oTr=document.createElement("TR"); 
        var 
oTd1=document.createElement("TD"); 
        
oTd1.setAttribute("align""left");
        var 
oTd2=document.createElement("TD");
        
oTd2.setAttribute("align""left"); 
        var 
oText=document.createTextNode("VEICOLO "+num
        var 
oField=document.createElement("SELECT");     
        
oField.setAttribute("name","veicolo"+num); 
        
        
nuovo1 = new Option('Auto','auto')
        
nuovo2 = new Option('Moto','moto')
        
nuovo3 = new Option('Ciclomotore','ciclomotore')
        
nuovo4 = new Option('Autocarro < 35q.li','autocarro')
        
nuovo5 = new Option('Autocarro > 35q.li','autocarro2')
        
nuovo6 = new Option('Autobus','autobus')
        
nuovo7 = new Option('Camper','camper')
        
nuovo8 = new Option('Motocarro','motocarro')
        
nuovo9 = new Option('Trattore','trattore')

        
oField.add(nuovo11);
        
oField.add(nuovo22);
        
oField.add(nuovo33);
        
oField.add(nuovo44);
        
oField.add(nuovo55);
                          
oField.add(nuovo66);
        
oField.add(nuovo77);
        
oField.add(nuovo88);
        
oField.add(nuovo99);

        
oTd1.appendChild(oText); 
        
oTd2.appendChild(oField); 
        
        
oTr.appendChild(oTd1); 
        
oTr.appendChild(oTd2); 
         
        
//Campo anno immatricolazione

        
var oTextAnno=document.createTextNode(" "
        var 
oFieldAnno=document.createElement("SELECT");
         
        
oFieldAnno.setAttribute("name","annoimm"+num); 
        
        
nuovo1 = new Option('Immatricolato tra il 1989 e 1979','annoimm20')
        
nuovo2 = new Option('Immatricolato tra il 1978 e 1901','annoimm30')

        
oFieldAnno.add(nuovo11);
        
oFieldAnno.add(nuovo22);

        
oTd2.appendChild(oTextAnno); 
        
oTd2.appendChild(oFieldAnno); 
        
        
oTr.appendChild(oTd1); 
        
oTr.appendChild(oTd2); 

        
//Fine campo anno immatricolazione

        
document.getElementById('mytable').getElementsByTagName('tbody')[0].appendChild(oTr); 
        
document.preventivo.quantita.value num;
        
num++ 
    } 


function 
delete_me() 

    if(
document.removeChild && document.getElementById && document.getElementsByTagName
    { 
        if(
num>2
        { 
            var 
tb=document.getElementById('mytable').getElementsByTagName('TBODY')[0]; 
            var 
lastTr=tb.getElementsByTagName('TR')[(tb.getElementsByTagName('TR').length)-1
            
document.preventivo.quantita.value = (num-2);
            
tb.removeChild(lastTr); 
            
num-- 
            
        } 
    } 



il problema è che su explorer funziona, su firefox no...e la console degli errori tira fuori il seguente messaggio

Errore: uncaught exception: [Exception... "Could not convert JavaScript argument arg 1 [nsIDOMHTMLSelectElement.add]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"