帮忙看一段检测表单的javascript哪有错,高分

来源:百度知道 编辑:UC知道 时间:2024/05/15 17:49:03
<script Language="JavaScript">
function FormCheck()
{
if (document.Form1.truename.value=="")
{
alert("请填写您的真实姓名!");
document.Form1.truename.focus();
return (false);
}
if (document.Form1.nickname.value=="")
{
alert("请填写您的昵称!");
document.Form1.nickname.focus();
return (false);
}
if (document.Form1.qq.value=="")
{
alert("请填写您的QQ号码!");
document.Form1.qq.focus();
return (false);
}
if (document.Form1.email.value=="")
{
alert("请填写您的电子邮件地址!");
document.Form1.email.focus();
return (false);
}
if (document.Form1.phone.value=="")
{
alert("请填写您的联系方式!");
document.Form1.phone.focus();
return (false);
}
if (document.Form1.address.value=="")
{
alert("请填写您的联系地址!");
document

你这样使用onclick提交不行.
在boby里的form1改成onSubmit下面是一个完整的onSubmit需要写的代码!
<body>
<form name="form1" onSubmit="return myform()"method="post" action="submit.htm">
</body>

一个小错误