al-Maghribi
Mitglied
hallo,
ich habe das problem, dass der "Gesamt" Feld NaN anzeigt !! ich verstehe nicht warum
hier schon mal mein Code
ich habe das problem, dass der "Gesamt" Feld NaN anzeigt !! ich verstehe nicht warum
hier schon mal mein Code
HTML:
<html>
<head>
<title>System Auswahl</title>
<script type="text/javascript">
var trans = 2;
function changed(obj){
var Men, einzel;
var totmbf = 0;
var num = obj.name.substr(3, obj.name.length - 3);
Men = parseInt(obj.value);
if (!(Men > 0)){
Men = 0;
obj.value = 0;
}
einzel = parseInt(document.form1['MBF' + num].value) * Men;
document.form1['AAA' + num].value = einzel;
for (var x = 0; x <= trans; x++)
totmbf += parseInt(document.form1['AAA' + x].value);
document.form1.totalmbf.value = totmbf;
}
</script>
</head>
<body bgcolor="#d3d3d3">
<p style="font-family:Arial,sans-serif; font-size:18px; color:blue">Ausgewählte Systeme: PRO-MT BALDWIN</p>
<hr size="1" noshade>
<form name='form1' onReset="return confirm('zurücksetzen ?');" method='POST' enctype='text/plain'>
<input type="reset" value="zurücksetzen" >
<hr size="1" noshade>
<br>
<TABLE BORDER=2>
<TR ALIGN=LEFT VALIGN=TOP ><TD><p><STRONG>KOMPONENTEN</STRONG></p></TD>
<TD><p><STRONG>MTBF</STRONG></p></TD>
<TD><p><STRONG>MTBIF</STRONG></p></TD>
<TD><p><STRONG>MTBSC</STRONG></p></TD>
<TD><p><STRONG>MENGE</STRONG></p></TD>
<TD><p><STRONG>MTBF_New</STRONG></p></TD>
<TD><p><STRONG>MTBIF_New</STRONG></p></TD>
<TD><p><STRONG>MTBSC_New</STRONG></p></TD>
</TR>
<TR ALIGN=LEFT VALIGN=TOP ></TR>
<TR ALIGN=LEFT VALIGN=TOP><TD>V.24 VEM</td><TD><input type='text' name='MBF0' value='100' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MIF0' value='100' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MSC0' value='100' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='Men0' size='15' maxlength='30' onchange='changed(this);' ></TD><TD><input type='text' size='15' name='AAA0' readonly='readonly' ></TD><TD><input type='text' size='15' name='BBB0' readonly='readonly' ></TD><TD><input type='text' size='15' name='CCC0' readonly='readonly' ></TD></TR>
<TR ALIGN=LEFT VALIGN=TOP><TD>14" SVGA MONITOR</td><TD><input type='text' name='MBF1' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MIF1' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MSC1' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='Men1' size='15' maxlength='30' onchange='changed(this);' ></TD><TD><input type='text' size='15' name='AAA1' readonly='readonly' ></TD><TD><input type='text' size='15' name='BBB1' readonly='readonly' ></TD><TD><input type='text' size='15' name='CCC1' readonly='readonly' ></TD></TR>
<TR ALIGN=LEFT VALIGN=TOP><TD>NVID16 + BOARD ONLY</td><TD><input type='text' name='MBF2' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MIF2' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='MSC2' value='' size='15' maxlength='30' readonly='readonly'></td><TD><input type='text' name='Men2' size='15' maxlength='30' onchange='changed(this);' ></TD><TD><input type='text' size='15' name='AAA2' readonly='readonly' ></TD><TD><input type='text' size='15' name='BBB2' readonly='readonly' ></TD><TD><input type='text' size='15' name='CCC2' readonly='readonly' ></TD></TR>
<TR ALIGN=LEFT VALIGN=TOP bgcolor='#FFFFCC'><td align='right' colspan='5'><strong>Gesamtsumme MTBF</strong></td><td><input name='totalmbf' type='text' size='15' value='0' readonly='readonly'/></td></TR>
<TR ALIGN=LEFT VALIGN=TOP bgcolor='#FFFFCC'><td align='right' colspan='6'><strong>Gesamtsumme MTBFI</strong></td><td><input name='totalmif' type='text' size='15' value='0' readonly='readonly'/></td></TR>
<TR ALIGN=LEFT VALIGN=TOP bgcolor='#FFFFCC'><td align='right' colspan='7' ><strong>Gesamtsumme MTBSC</strong></td><td><input name='totalmsc' type='text' size='15' value='0' readonly='readonly'/></td></TR>
</TABLE>
</form>
</body>
</html>