con i cicli non mi trovo, quindi ho provato cosi', ma nada
codice:function calculateTotal() { one = parseInt(document.questions.one.value); two = parseInt(document.questions.two.value); three = parseInt(document.questions.three.value); four = parseInt(document.questions.four.value); five = parseInt(document.questions.five.value); six = parseInt(document.questions.six.value); seven = parseInt(document.questions.seven.value); eight = parseInt(document.questions.eight.value); nine = parseInt(document.questions.nine.value); ten = parseInt(document.questions.ten.value); eleven = parseInt(document.questions.eleven.value); twelve = parseInt(document.questions.twelve.value); thirteen = parseInt(document.questions.thirteen.value); fourteen = parseInt(document.questions.fourteen.value); fifthteen = parseInt(document.questions.fifthteen.value); sixteen = parseInt(document.questions.sixteen.value); seventeen = parseInt(document.questions.seventeen.value); eighteen = parseInt(document.questions.eighteen.value); nineteen = parseInt(document.questions.nineteen.value); twenty = parseInt(document.questions.twenty.value); result = one + two + three + four + five + six + seven + eight + nine + ten + eleven + twelve + thirteen + fourteen + fifthteen + sixteen + seventeen + eighteen + nineteen + twenty; alert("Tot: " + result); }


Rispondi quotando