03.
<head>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
/>
05.
<title>Untitled Document</title>
06.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
>
07.
<script language=
"JavaScript"
src=
"clinicsystem/calendar_eu.js"
></script>
08.
<link rel=
"clinicsystem/stylesheet"
href=
"clinicsystem/calendar.css"
>
09.
<style type=
"text/css"
>
10.
<!--
11.
.style2 {font-family: AngsanaUPC}
12.
.style33 {font-family:
"MS Sans Serif"
}
13.
.style34 {font-family:
"MS Sans Serif"
; font-weight: bold; font-size: 12px; }
14.
.style37 {font-family:
"MS Sans Serif"
; font-weight: bold; font-size: 14px; }
15.
.style38 {font-size: 14px}
16.
.style39 {font-family:
"MS Sans Serif"
; font-size: 14px; }
17.
-->
18.
</style>
19.
</head>
20.
21.
22.
<script>
23.
function
getAge(dateString) {
24.
var
today =
new
Date
();
25.
var
birthDate =
new
Date
(dateString);
26.
var
age = today.getFullYear() - birthDate.getFullYear();
27.
var
m = today.getMonth() - birthDate.getMonth();
28.
if
(m < 0 || (m === 0 && today.
getDate
() < birthDate.
getDate
())) {
29.
age--;
30.
}
31.
if
(age !=
""
)
32.
{
33.
document.getElementById(
'pt_age'
).value = age;
34.
}
35.
}
36.
</script>
37.
38.
39.
<body>
40.
<table width=
"590"
border=
"0"
align=
"center"
cellspacing=
"3"
bgcolor=
"#FFFFFF"
>
41.
<tr>
42.
<td height=
"14"
bgcolor=
"#dcf9ff"
><span
class
=
"style37"
><span
class
=
"style2 style33"
><strong>วัน/เดือน/ปีเกิด
43.
<label><font color=
"#FF0000"
>**</font></label>
44.
</strong></span></span></td>
45.
<td bgcolor=
"#dcf9ff"
><span
class
=
"style39"
>
46.
<label></label>
47.
<span
class
=
"style34 style33 style38"
>
48.
<input name=
"pt_birth"
type=
"text"
id=
"pt_birth"
onchange=
"calAge(this);"
/>
49.
<script language=
"JavaScript"
type=
"text/javascript"
>
50.
new
tcal ({
51.
52.
'formname'
:
'frmregister'
,
53.
54.
'controlname'
:
'pt_birth'
55.
});
56.
57.
</script>
58.
</span></span></td>
59.
</tr>
60.
<tr>
61.
<td bgcolor=
"#dcf9ff"
><span
class
=
"style37"
>อายุ</span></td>
62.
<td bgcolor=
"#dcf9ff"
><span
class
=
"style34 style33 style38"
>
63.
<label> </label>
64.
<span
class
=
"style39"
>
65.
<input name=
"pt_age"
type=
"text"
id=
"pt_age"
size=
"20"
maxlength=
"20"
/>
66.
</span></span></td>
67.
</tr>
68.
</table>
69.
</body>
70.
</html>