日期:2014-05-16 浏览次数:20340 次
<SCRIPT language=javascript> function CheckPost() { if (myform.user.value==""} { alert("please input user name!"); myform.user.focus(); return false; } if (myform.title.value.length<5) { alert("Title length can't less 5 chars"); myform.title.focus(); return false; } } </SCRIPT> <form action="add.php" method="POST" name="myform" onsubmit="return CheckPost();"> User :<input type="text" size=10 name="user"/><br> Title :<input type="text" size=20 name="title"/><br> Content :<TextArea name="content" rows=10 ></TextArea><br> <input type="submit" name="submit" value="Send Message"/> </form>