Hello all,

I have this calculation form where the customers can make an calculation

I would like to have the in and output fields changed to the table as shown below

Can anyone have a look and tell me what to change in the script to display the outcome from the calculation in the table form.

thanks a lot

<html>
<head>
<title>app__nl</title>
<script type="text/javascript" language="javascript">
<!--
function calcVals(){
form = document.form1;
//Waarden om mee te rekenen
RV53bMX = 520;
RV53bMY = 374;
DstmX = 10;
DstmY = 10;
DvsX = 5;
DvsY = 5;
DvrX = 1.5;
DvrY = 1.5;
RDX = 12;
RDY = 10;
STMX = form.textfield;
STMY = form.textfield1;
RSTM = form.textfield2;
//Berekening
STMX = parseFloat(STMX.title * STMX.value);
STMY = parseFloat(STMY.title * STMY.value);
RSTM = parseFloat(RSTM.title * RSTM.value);
DrvX = parseFloat(RDX + DvrX);
DrvY = parseFloat(RDY + DvrY);
VMX = parseFloat(RV53bMX - (2 * DrvX));
VMY = parseFloat(RV53bMY - (2 * DrvY));
NXa = parseFloat((VMX + (((DstmX / 2) - DvsX) * 2))/(STMX + DstmX));
NYa = parseFloat((VMY + (((DstmY / 2) - DvsY) * 2))/(STMY + DstmY));
NX = Math.floor(NXa);
NTX = parseFloat(NX - 1);
NY = Math.floor(NYa);
NTY = parseFloat(NY - 1);
NTot = parseFloat( NX * NY );
AVPX = parseFloat((NX * STMX) + (NTX * DstmX) + (2 * DvsX));
AVPY = parseFloat((NY * STMY) + (NTY * DstmY) + (2 * DvsY));
ARX = parseFloat(AVPX + (2 * DrvX));
ARY = parseFloat(AVPY + (2 * DrvY));
ML1a = parseFloat(((2*(STMX+STMY))-(8*RSTM))+(2*3.1415926*RSTM));
ML1 = ML1a.toFixed(2);
MLtot = parseFloat(ML1 * NTot);
//Uitvoer
total = MLtot;
if (String(total) != 'NaN') {
form.valTotal.value = total;
} else {
form.valTotal.value = 'ERROR';
}
}
-->
</script>
</head>


<body>
<strong>Berekening</strong>
<form id="form1" name="form1" method="post" action="" >
STM X <input type="number" name="textfield"title="1" onkeyup="calcVals()"/><br/>
STM Y <input type="number" name="textfield1" title="1" onkeyup="calcVals()"/><br/>
R STM <input type="number" name="textfield2"title="1" onkeyup="calcVals()"/><br/>
MLtot : <input type="number" readonly="" name="valTotal" id="valTotal" /><br/>
</form>
</body>
</html>

see below for the required table

STM X Y R
STM X (Input) STM Y (Input) R STM (Input)
N NX (Output) NY (Output) NTot (Output)
AVP AVPX (Output) AVPY (Output)
AR ARX (Output) ARY (Output)
ML MLtot (Output)

thanks