[html]代码库
方法一:
< script LANGUAGE=" JavaScript ">
function checkvalue() { if (document.welcomeform.nickname.value == ""
) { alert( " 昵称不能为空! " ); return ( false ); } if (document.welcomeform.password.value
== "" ) { alert( " 密码不能为空! " ); return ( false ); } document.welcomeform.submit();
return ( true ); }
</ script>
< body>
< form name=" welcomeform " method=" post " action=" welcome.asp ">
< a href=" # " onclick=" javascript:checkvalue();return false: ">
登录
</ a>
</ form>
</ body>
方法二:
<form name="welcomeform" method="post" action="welcome.asp">
<input type=text>
</form>
<a href="javascript:welcomeform.submit();">提交</a>