
نوشته اصلی توسط
alborzhost
سلام ,
کد شما اصلاح شد فقط در فرمول شک داریم که اگر فرمول رو شفاهی بدید اون هم درست میشه.
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
function calculate(length, width, dollar) {
alert((dollar.value * length.value) + (((width.value + 10) / 100) * 16000));
}
</script>
</head>
<body>
<form name="frm">
<table>
<tr>
<td>وزن بلبرینگ</td>
<td><input type="text" name="len"/></td>
</tr>
<tr>
<td>فی دلار با تخفیف</td>
<td><input type="text" name="wid"/></td>
</tr>
<tr>
<td>قیمت دلار امروز</td>
<td><input type="text" name="dollar"/></td>
</tr>
<tr>
<td><input type="button" name="Submit" value="Submit"
onClick="calculate(document.frm.len, document.frm.wid, document.frm.dollar)"/></td>
</tr>
</table>
</form>
</body>
</html>