?1
<
script?LANGUAGE
=
"
JavaScript
"
>
?2
function
?checkvalue()
?3
{
?4
??
if
(document.welcomeform.nickname.value
==
""
)
?5
??
{
?6
???alert(
"
昵稱不能為空!
"
);
?7
???
return
(
false
);
?8
???}
?9
??
if
(document.welcomeform.password.value
==
""
)
10
??
{
11
???alert(
"
密碼不能為空!
"
);
12
???
return
(
false
);????
13
???}
14
??document.welcomeform.submit();?
15
??
return
(
true
);???
16
}
17
</
script
>
18
19
<
body
>
20
<
form?name
=
"
welcomeform
"
?method
=
"
post
"
?action
=
"
welcome.asp
"
>
21
??
<
a?href
=
"
#
"
?onclick
=
"
javascript:checkvalue();return?false:
"
>
登錄
</
a
>
22
</
form
>
?
23
</
body
>

?2

?3



?4

?5



?6

?7

?8

?9

10



11

12

13

14

15

16

17

18

19

20

21

22

23

第二種方式
1
<form?name="welcomeform"?method="post"?action="welcome.asp">?
2
<input?type=text>?
3
</form>?
4
<a?href="javascript:welcomeform.submit();">提交</a>
5

2

3

4

5
