网页里面的这段程序什么意思啊,麻烦介绍一下了。他是把表单提交到那了在那看啊!

来源:百度知道 编辑:UC知道 时间:2024/05/28 19:55:39
<SCRIPT language=JavaScript>

function checkform(theForm)
{

if (theForm.name.value==""){
alert("请输入您的姓名!");
theForm.name.focus();
return false;
}
if (theForm.phone.value==""){
alert("请输入您的联系电话!");
theForm.phone.focus();
return false;
}
if(theForm.address.value=="")
{
alert("请输入您的收货地址!");
theForm.address.focus();
return false;
}

return true;
}

</SCRIPT>

这是js验证函数。
function checkform(theForm) //theForm 是表单对象 <form ></form>
{

if (theForm.name.value==""){
alert("请输入您的姓名!"); //弹出警告对话框
theForm.name.focus(); //将焦点设置到 <input type=text name=name>
return false; //返回 false, 不允许提交
}

return true;
}

是这样的意思:
这是一断Javascript代码, 判断请入的内容是否为空,如果为空就返回.
这断代码应该是要提交表单的时候进行检查用户是否把要填的内容都填好了,如果没有填完整,就不提交表单.

这只是判断,看你填写的内容,没提交到服务器,。