我的网页问题在哪?

来源:百度知道 编辑:UC知道 时间:2024/06/13 23:15:47
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function check()
{
if(form1.textfield value=="")
{window.alert("用户名不能为空");
form1.textfield.focus();}
}

</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<table width

这哥们一看就够粗心的,呵呵O(∩_∩)O~...

看你的check函数里的:

if(form1.textfield value=="")

里边的“点”你给吃了吧?O(∩_∩)O~...

把我下面改的这个函数复制了,替换一下你的那个试试

function check()
{
if(form1.textfield.value=="")
{window.alert("用户名不能为空");
form1.textfield.focus();}
}

以后写代码的时候细心点,呵呵...O(∩_∩)O~