function calcul() {
salaire = window.parseInt(document.myForm.txtSalaire.value);
temps = window.parseInt(document.myForm.txtTemps.value);
for (i = 0; i < monnaie.length; i++) {
profit = monnaie[i] - (salaire/DIVISEUR) * temps;
profit = profit.toFixed(3);
document.myForm.txtMonnaie[i].value = monnaie[i] + "$";
document.myForm.txtProfit[i].value = profit;
}
}
... <input type="text" name="txtMonnaie0"/>
I want to run through all my inputs to set new values to 'name="txtMonnaie[]"' and txtProfit[] using i as the parameter.
myForm.txtMonnaie is undefined.
monnaie
? – bfavaretto Feb 6 '13 at 16:55body
element) – Marcel Korpel Feb 6 '13 at 16:59