Prova cosi:
codice:function calcolo_pre () { var base = 150; var pagine = document.getElementById('num_pag').value; var ck_motori = document.getElementById('motori'); var ck_statistiche = document.getElementById('statistiche'); var ck_modulo = document.getElementById('modulo_contatto'); var somma = 0; if (ck_motori.checked) { ck_motori = 50; } else {ck_motori = 0;} if (ck_statistiche.checked) { ck_statistiche = 50; } else {ck_statistiche = 0;} if (ck_modulo_contatti.checked) { ck_modulo_contatti = 50; } else {ck_modulo_contatti = 0;} somma = (pagine * 35) + base + motori + statistiche + modulo; document.form['calcolo'].elements['totale'].value = somma; }
P.S. campo totale disabilitato :master: forse è meglio readonly (solo lettura)


Rispondi quotando