Ciao floyd,
innanzitutto grazie dell'aiuto, ho scritto come mi dicevi, ma purtroppo però se nelle funzioni delle addizioni continuo a saltare un campo questo non viene ancora considerato come nullo ma continuo ad avere come risultato zero. Ti riporto lo script modificato in base alle tue indicazioni.
codice:
<script language = "Javascript">
function taLimit() {
var taObj=event.srcElement;
if (taObj.value.length==taObj.maxLength*1) return false;
}
function taCount(visCnt) {
var taObj=event.srcElement;
if (taObj.value.length>taObj.maxLength*1) taObj.value=taObj.value.substring(0,taObj.maxLength*1);
if (visCnt) visCnt.innerText=taObj.maxLength-taObj.value.length;
}
function division1()
{
var div1, div2, resultwe;
div1 = parseFloat(document.form1.divis1.value);
div2 = parseFloat(document.form1.divisore.value);
resultwe = div1 / div2;
document.form1.txtNumber1.value = resultwe;
}
function division2()
{
var div3, div4, resultwr;
div3 = parseFloat(document.form1.divis2.value);
div4 = parseFloat(document.form1.divisore.value);
resultwr = div3 / div4;
document.form1.txtNumber2.value = resultwr;
}
function division3()
{
var div5, div6, resultqw;
div3 = parseFloat(document.form1.divis3.value);
div4 = parseFloat(document.form1.divisore.value);
resultqw = div3 / div4;
document.form1.txtNumber3.value = resultqw;
}
function addition()
{
var number1, number2, number3, result;
var txtNumber1 = document.form1.txtNumber1.value;
var txtNumber2 = document.form1.txtNumber2.value;
var txtNumber3 = document.form1.txtNumber3.value;
number1 = (isNaN(txtNumber1))? 0 : parseFloat(document.form1.txtNumber1.value);
number2 = (isNaN(txtNumber2))? 0 : parseFloat(document.form1.txtNumber2.value);
number3 = (isNaN(txtNumber3))? 0 : parseFloat(document.form1.txtNumber3.value);
result =(number1 + number2 + number3);
document.form1.txtResult.value=result;
}
function addition2()
{
var number4, number5, number6, resultz;
var divis1 = document.form1.divis1.value;
var divis2 = document.form1.divis2.value;
var divis3 = document.form1.divis3.value;
number4 = (isNaN(divis1))? 0 : parseFloat(document.form1.divis1.value);
number5 = (isNaN(divis2))? 0 : parseFloat(document.form1.divis2.value);
number6 = (isNaN(divis3))? 0 : parseFloat(document.form1.divis3.value);
resultz =(number4 + number5 + number6);
document.form1.txtResultz.value=resultz;
}
</script>