003.
<head>
004.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
005.
<title>สมัครสมาชิก</title>
006.
<style type=
"text/css"
>
007.
<!--
008.
body {
009.
margin-left: 0px;
010.
margin-top: 0px;
011.
margin-right: 0px;
012.
margin-bottom: 0px;
013.
}
014.
-->
015.
</style></head>
016.
<script language=
"javascript"
>
017.
function
check(){
018.
if
(document.form1.txtuser.value==
""
){
019.
alert(
"กรุณาป้อน User ท่านด้วยครับ"
);
020.
document.form1.txtuser.focus();
021.
return
false;
022.
}
023.
else
if
(document.form1.txtemail.value==
""
){
024.
alert(
"กรุณาป้อนEmail ที่ใช้ในการสมัคร"
);
025.
document.form1.txtemail.focus();
026.
return
false;
027.
}
028.
else
if
(document.form1.txtpass.value==
""
){
029.
alert(
"กรุณากำหนดรหัสผ่าน"
);
030.
document.form1.txtpass.focus();
031.
return
false;
032.
}
033.
else
if
(document.form1.txtpass.value.length>=10){
034.
alert(
"กรุณากำหนดรหัส6-10ตัวอักษร"
);
035.
document.form1.txtpass.select();
036.
return
false;
037.
}
038.
else
if
(document.form1.txtconpass.value==
""
){
039.
alert(
"กรุณายืนยันรหัสผ่าน"
);
040.
document.form1.txtconpass.focus();
041.
return
false;
042.
}
043.
}
044.
return
true;
045.
}
046.
047.
function
chkconpass(){
048.
if
(document.form1.txtconpass.value != document.form1.txtconpass.value){
049.
alert(
"กรุณากรอกรหัสผ่านให้ตรงกัน"
);
050.
document.form1.txtconpass.focus();
051.
return
false;
052.
}
053.
}
054.
return
true;
055.
}
056.
057.
function
checkText()
058.
{
059.
var
elem = document.getElementById(
'test_txt'
).value;
060.
if
(!elem.match(/^([a-z0-9\_])+$/i))
061.
{
062.
alert(
"กรอกได้เฉพาะ a-Z, A-Z, 0-9 และ _ (underscore)"
);
063.
document.getElementById(
'test_txt'
).value =
""
;
064.
}
065.
}
066.
</script>
067.
<body>
068.
<form id=
"form1"
name=
"form1"
method=
"post"
action=
"saveregister.php"
onsubmit=
"return check()"
>
069.
<table width=
"581"
border=
"1"
align=
"center"
cellspacing=
"10"
bordercolor=
"#FFFFFF"
bgcolor=
"#FF6699"
>
070.
<tr>
071.
<td colspan=
"2"
align=
"center"
valign=
"middle"
>สมัครสมาชิกใหม่</td>
072.
</tr>
073.
<tr>
074.
<td width=
"223"
align=
"right"
valign=
"middle"
>ชื่อ</td>
075.
<td width=
"318"
align=
"left"
valign=
"middle"
><label>
076.
<input name=
"txtuser"
type=
"text"
id=
"txtuser"
size=
"35"
maxlength=
"50"
/>
077.
</label></td>
078.
</tr>
079.
<tr>
080.
<td align=
"right"
valign=
"middle"
>อีเมลเพื่อเป็นล็อกอิน</td>
081.
<td align=
"left"
valign=
"middle"
><label>
082.
<input name=
"txtemail"
type=
"text"
id=
"txtemail"
size=
"35"
maxlength=
"50"
/>
083.
</label></td>
084.
</tr>
085.
<tr>
086.
<td align=
"right"
valign=
"middle"
>รหัสผ่าน</td>
087.
<td align=
"left"
valign=
"middle"
><label>
088.
<input name=
"txtpass"
type=
"password"
id=
"txtpass"
size=
"10"
maxlength=
"10"
onblur=
"checkText();"
/>
089.
</label></td>
090.
</tr>
091.
<tr>
092.
<td align=
"right"
valign=
"middle"
>ใส่รหัสผ่านซ้ำ</td>
093.
<td align=
"left"
valign=
"middle"
><label>
094.
<input name=
"txtconpass"
type=
"password"
id=
"txtconpass"
size=
"10"
maxlength=
"10"
onkeypress=
"chkconpass();"
/>
095.
</label></td>
096.
</tr>
097.
<tr>
098.
<td align=
"right"
valign=
"middle"
></td>
099.
<td align=
"left"
valign=
"middle"
><label>
100.
<input type=
"submit"
name=
"button"
id=
"button"
value=
"สมัครสมาชิก"
/>
101.
</label></td>
102.
</tr>
103.
<tr>
104.
<td colspan=
"2"
align=
"center"
valign=
"middle"
>ชื่อและล็อกอินต้องไม่ซ้ำกับสมาชิกท่านอื่นและกรุณาใช้อีเมลจริงของท่าน</td>
105.
</tr>
106.
</table>
107.
</form>
108.
</body>
109.
</html>