帮忙找问题

hamutailangliuxingyu 2009-08-25 09:09:22
<%
Dim conn
ArtSoft_Conn
Action=Request.Form("action")
If action="add_admin" Then
ent_title=Request.Form("ent_title")
ent_content=request.Form("ent_content")
news_addtimes=formatdatetime(now,1)
ent_author=Session("ADName")
sql="insert into environmental(ent_title,ent_content,ent_author,news_addtimes) values('"+ent_title+"','"+ent_content+"','"+ent_author+"','"+news_addtimes+"')"
conn.Execute sql
conn.Close
set conn=nothing
Response.Redirect"del_environmental.asp"
end if
%>
<HTML>
<HEAD>
<Title>环保知识</Title>
<link rel="stylesheet" href="css/css.css" type="text/css" />
<script type="text/javascript" charset="utf-8" src="./../kindeditor/kindeditor.js"></script>
<script type="text/javascript">
KE.show({
id : 'content2',
cssPath : './index.css',
items : [
'undo', 'redo', 'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist']
});

function check()
{
if(document.form1.ent_title.value=="")
{
alert("环保知识不能为空!!");
return false;
}
if(document.form1.ent_content.value=="")
{
alert("环保知识内容不能为空!!");
return false;
}
return true;
}
</script>

<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<META name="Generator" content="Asp Studio 1.0">
</HEAD>

<BODY>
<!-- 请在这里输入您的HTML代码 -->
<form action="" name="form1" method="post">
<table width="500" border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#799AE1" class=tableBorder>
<tbody>
<tr>
<th align=center colspan=2 style="height: 23px">环保知识</th>
</tr>
<tr>
<table width="585" border="0" align=center cellpadding=2 cellspacing=1 bordercolor="#799AE1" class=tableBorder>
<tr bgcolor="#DEE5FA" align="left">
<td colspan="4" align="center" class=txlrow> </td>
</tr>
<tr bgcolor="#DEE5FA">
<td width="79" align="center">标题:</td>
<td width="500" colspan="2" align="left"><input type="text" name="ent_title" /></td>
</tr>
<tr bgcolor="#DEE5FA">
<td align="center">内容:</td>
<td colspan="3">
<textarea id="content2" name="ent_content" style="width:500px;height:200px;visibility:hidden;"></textarea> </td>
</tr>
<tr bgcolor="#DEE5FA">
<td colspan="4" align="center"><input name="submit" type="submit" value="提交" onClick="return check()"/>     
<input type="hidden" name="action" value="add_admin"/> </td>
</tr>
</table>
</tr>
</tbody>
</table>
</form>

</BODY>

</HTML>
不管内容是否输入他总是提示内容不能为空,视乎if(document.form1.ent_content.value=="")
永远取不到值是的,为什么啊,一开始还好的后来几次运行就出现这种现象了,为什么啊?帮忙找一下问题
...全文
84 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
可以输入的
就算去掉也不行呀,还是上面的问题。。。。
chinabh 2009-08-25
  • 打赏
  • 举报
回复
<textarea id="content2" name="ent_content" style="width:500px;height:200px;visibility:hidden;"> </textarea>
这个多文本框你可以输入?
你不是已经visibility:hidden了
  • 打赏
  • 举报
回复
没有人知道啊???
document.getElementById("content2").value== ""
这样也取不到值为什么啊????
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 sy_binbin 的回复:]
<textarea id="ent_content" name="ent_content" style="width:500px;height:200px;visibility:hidden;"> </textarea>
[/Quote]
我昨天已经试过了没有用
sy_binbin 2009-08-25
  • 打赏
  • 举报
回复
<textarea id="ent_content" name="ent_content" style="width:500px;height:200px;visibility:hidden;"> </textarea>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧