<!-- function Ju" name="description" />
下一頁 1 2
//作者:叨叨
//email:pjzhp@263.net
//客戶端對用戶輸入數據校驗
//如果輸入的內容不滿足,則不提交,并且焦點自動跳到該位置。
//比發送以后在服務器端校驗數據要好用的多!
腳本代碼:
<script language="JavaScript">
<!--
function Juge(theForm)
{
if (theForm.title.value == "")
{
alert("請輸入標題!");
theForm.title.focus();
return (false);
}
if (theForm.detail.value == "")
{
alert("請輸入內容!");
theForm.detail.focus();
return (false);
}
if (theForm.name.value == "")
{
alert("請輸入作者!");
theForm.name.focus();
return (false);
}
if (theForm.email.value == "")
{
alert("請輸入信箱!");
theForm.email.focus();
return (false);
}
}
-->
</script>