linux elf 文件格式:网页编程多行文本框??高手帮我看看谢谢了

来源:百度文库 编辑:高考问答 时间:2024/05/05 16:08:31
网页编程多行文本框的非空验证怎么写啊```
以下是我写的.运行不成功.换成TEXT就可以运行
<script>
function noempty(obj)
{
if(obj.txtresume.value=="")
{
alert("姓名不能为空!");
obj.txtresume.focus();
return false;
}

}
</script>

<form action="logado.asp" method=post border=0 onSubmit="return noempty(this);">

<br>
<textarea rows=10 cols=10 name=txtresume></textarea>
<br>
<input type=submit name=cmdOK value="应聘">
</form>

<!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>
</head>

<body>
<script>
function noempty(obj)
{
if(obj.txtresume.value=="")
{
alert("姓名不能为空!");
obj.txtresume.focus();
return false;
}

}
</script>

<form action="logado.asp" method=post border=0 onSubmit="return noempty(this);">

<br>
<textarea rows=10 cols=10 name=txtresume></textarea>
<br>
<input type=submit name=cmdOK value="应聘">
</form>
</body>
</html>

我测试没有问题,这是我测试的全部代码,你可以看一下你的代码顶部有没有这两行,<!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">

加一个判断语句就可以了