<form name="myform" action="###" method="post" onsubmit="check()">
<label for="name"> 賬號:</label><input type="text" size="20" value="" placeholder="請輸入賬號" name="name" id="name" /><br />
<label for="pw" > 密碼:</label><input type="password" id="pw" name="pw" placeholder="請輸入密碼" value="" /><br />
<input type="submit" value="登錄" /><input type="reset" value="重置" />
</form>
From 的onsubmit應該是 onsubmit="return check()"
事件裡面要返回一個布爾值