03.
<head>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
05.
<title></title>
06.
<script language=
"javascript"
>
07.
function
alertData(){
08.
var
txt1 = document.getElementById(
'test1'
).value;
09.
var
txt2 = document.getElementById(
'test2'
).value;
10.
var
txt3 = document.getElementById(
'test3'
).value;
11.
var
txt4 = document.getElementById(
'test4'
).value;
12.
var
total = document.getElementById(
'total'
);
13.
var
to = document.getElementById(
'to'
);
14.
if
(txt1 ==
""
){txt1 = 0;}
15.
if
(txt2 ==
""
){txt2 = 0;}
16.
if
(txt3 ==
""
){txt3 = 0;}
17.
if
(txt4 ==
""
){txt4 = 0;}
18.
total.value = parseFloat(txt1)*parseFloat(txt2);
19.
to.value = parseFloat(txt3)*parseFloat(txt4);
20.
kilo.value = parseFloat(txt1)+parseFloat(txt3);
21.
muny.value=parseFloat(total.value)+parseFloat(to.value);
22.
}
23.
</script>
24.
</head>
25.
<body>
26.
<center>1. ผลปาล์มทะลาย<br />
27.
จำนวนกิโล<input name=
"test1"
id=
"test1"
type=
"text"
onkeyup=
"alertData()"
/>
28.
ราคา<input name=
"test2"
id=
"test2"
type=
"text"
onkeyup=
"alertData()"
/> รวมเป็นเงิน
29.
<input name=
"total"
id=
"total"
type=
"text"
/>
30.
</center><br />
31.
<center>2. ผลปาล์มร่วง<br />
32.
จำนวนกิโล<input name=
"test3"
id=
"test3"
type=
"text"
onkeyup=
"alertData()"
/>
33.
ราคา<input name=
"test4"
id=
"test4"
type=
"text"
onkeyup=
"alertData()"
/> รวมเป็นเงิน
34.
<input name=
"to"
id=
"to"
type=
"text"
/>
35.
</center>
36.
<br />
37.
<br />
38.
<center>
39.
รวมจำนวน กิโลกรัม<input name=
"kilo"
id=
"kilo"
type=
"text"
/>
40.
รวมจำนวน เงิน<input name=
"muny"
id=
"muny"
type=
"text"
/>
41.
</center>
42.
<?
echo
ceil
( 1.50 ); ?>
43.
</body>
44.
</html>