01.
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN"
>
02.
<HTML>
03.
<HEAD>
04.
<TITLE> New Document </TITLE>
05.
<META NAME=
"Generator"
CONTENT=
"EditPlus"
>
06.
<META NAME=
"Author"
CONTENT=
""
>
07.
<META NAME=
"Keywords"
CONTENT=
""
>
08.
<META NAME=
"Description"
CONTENT=
""
>
09.
</HEAD>
10.
11.
<BODY>
12.
13.
<SCRIPT Language=
"JavaScript"
>
14.
15.
function
startCalc(){
16.
interval = setInterval(
"calc()"
,1);
17.
}
18.
function
calc(){
19.
one = document.autoSumForm.price.value;
20.
21.
totalfee1 = document.autoSumForm.totalfee.value = (one * 1) * .07;
22.
23.
24.
priceandfee1 = document.autoSumForm.priceandfee.value = (one * 1) - totalfee1;
25.
26.
document.autoSumForm.quantity.value = priceandfee1 / 20;
27.
28.
29.
}
30.
function
stopCalc(){
31.
clearInterval(interval);
32.
}
33.
</SCRIPT>
34.
35.
<div style=
"width: 200px; text-align: center;"
>
36.
<form name=
"autoSumForm"
>
37.
38.
<table width=
"685"
border=
"0"
>
39.
<tr>
40.
<td><div align=
"left"
>จำนวนเงิน</div></td>
41.
<td><div align=
"left"
>ค่าธรรมเนียม</div></td>
42.
<td><div align=
"left"
>จำนวนเงินหลังหักค่าธรรมเนียม</div></td>
43.
<td><div align=
"left"
>จำนวนหน่วยที่ได้รับ</div></td>
44.
</tr>
45.
<tr>
46.
<td width=
"144"
>
47.
<div align=
"left"
>
48.
<input
class
=
"right"
type=
"text"
name=
"price"
value=
""
onFocus=
"startCalc();"
onBlur=
"stopCalc();"
id=
"price"
>
49.
</div></td>
50.
<td width=
"159"
><div align=
"left"
>
51.
<input
class
=
"right"
type=
"text"
name=
"totalfee"
id=
"totalfee"
>
52.
</div></td>
53.
<td width=
"368"
><div align=
"left"
>
54.
<label
for
=
""
></label>
55.
<input name=
"priceandfee"
type=
"text"
id=
"priceandfee"
>
56.
</div></td>
57.
<td width=
"368"
><div align=
"left"
>
58.
<label
for
=
""
></label>
59.
<input name=
"quantity"
type=
"text"
id=
"quantity"
>
60.
</div></td>
61.
</tr>
62.
</table>
63.
<p> </p>
64.
</form>
65.
</div>
66.
</BODY>
67.
</HTML>