阅读内容 

javascript进行客户端数据的校验(1)

[日期:2005-04-24] 来源:中国站长学院  作者:郁郁小蝎 [字体: ]
//客户端对用户输入数据校验
//如果输入的内容不满足,则不提交,并且焦点自动跳到该位置。
//比发送以后在服务器端校验数据要好用的多!

脚本代码:

<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>
阅读:
录入:

推荐 】 【 打印
相关新闻      
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:
Advertisement
内容查询


Advertisement