01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com Tutorial</title>
04.
</head>
05.
<body>
06.
<script language=
"javascript"
>
07.
function
fncSubmit()
08.
{
09.
if
(document.form1.txt1.value ==
""
)
10.
{
11.
alert(
'Please input Input 1'
);
12.
document.form1.txt1.focus();
13.
return
false
;
14.
}
15.
if
(document.form1.txt2.value ==
""
)
16.
{
17.
alert(
'Please input Input 2'
);
18.
document.form1.txt2.focus();
19.
return
false
;
20.
}
21.
document.form1.submit();
22.
}
23.
</script>
24.
<form action=
"page.cgi"
method=
"post"
name=
"form1"
onSubmit=
"JavaScript:return fncSubmit();"
>
25.
Input 1 <input name=
"txt1"
type=
"text"
><br>
26.
Input 2 <input name=
"txt2"
type=
"text"
><br>
27.
<input name=
"btnSubmit1"
type=
"submit"
value=
"Submit"
>
28.
</form>
29.
</body>
30.
</html>