allora, rendiamolo un po ¨piu generale

<script>
function formatta(sel,pr){
valore=sel.options[sel.selectedIndex].value;
testo=document.my_form.testo;
if(pr.indexOf(".")>-1){
pr=new Array(pr.substring(0,pr.indexOf(".")),pr.substring (pr.indexOf(".")+1));
testo[pr[0]][pr[1]]=valore
}
else testo[pr]=valore;
}
</script>


ora lo richiami cosi:


formatta(select,proprieta)

esempio:

formatta(this,"style.color");
formatta(this,"name");
formatta(select,"id");


this lo usi se fai partire la funzione da un evento della select, altrimenti devi usare un riferimento alla select del tipo document.nomeform.nomeselect (al posto di this)