<HTML> <HEAD><TITLE>表單對象的事件</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function validateFirstName(){......}
function validateLastName() {......}
function validateEmail() {......}
function processForm() {......}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF"><H2 ALIGN="CENTER">處理表單事件</H2><HR>
<FORM name="form1"><P>名字:
<INPUT TYPE="text" NAME="fname" size=10 onBlur="validateFirstName();">姓氏:
<INPUT TYPE="text" NAME="lname" size=15 onBlur="validateLastName();"></p><P> Email:
<INPUT TYPE="text" NAME="email" size=10 onBlur="validateEmail();">附註:
<TEXTAREA NAME="comment" rows=4 cols=30 >請輸入附註</TEXTAREA></p><P ALIGN="CENTER">
<INPUT TYPE="button" value="提交此表單" onClick="processForm();"><INPUT TYPE="reset" value="重置"></P>
</FORM>
</BODY></html>
html