这段定义在头部~
<script language=javascript> function isfull() { var title = document.myform.title.value; var content = document.myform.content.value; if(title == "") { alert("标题呢?"); document.myform.title.focus(); return false; } if(content == "") { alert("输入内容~..."); document.myform.content .focus(); } return true; } </script>
这段是表单提交
<form action="add.asp?action=add" method="post" name="myform" id="myform" >