asp问题..在线等

wjp16351 2008-12-24 10:31:32
......................
.........................
上面是查询语句
if rs.eof and rs.bof then
response.write("?????????")
end if

.................................
.........................................

<td height="50" id="mycheck" colspan="2" align="center" valign="middle" style="padding-left:50px; display:none"> </td>

红色部分我这样写的 <script>document.all('mycheck').style.display=''; </script>
为什么当数据库里没数据的时候还是显示不出这个td来呢
————————————————————————————————————
源文件
——————————————————————————————————————
<!--#include file="../inc/conn.asp"-->
<%
if request.form.count>0 then
login_email=trim(request.Form("login_email"))
login_pwd=trim(request.Form("login_pwd"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from user_news where user_email='"&login_email&"' and user_pwd='"&login_pwd&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write(" <script>document.all('mycheck').style.display=''; </script>")
rs.close
end if
end if
%>
<!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>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #000000;
}
body {
margin-left: 0px;
margin-top: 20px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="../inc/my.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
function go_url(){
{
parent.location.href="../reg/index.asp";
self.parent.pop.closeWindow();
}
}
function check_login(){
if(document.form1.login_email.value==""){
document.all("mycheck").style.display="";
document.form1.login_email.focus();
return false;
}
if(document.form1.login_pwd.value==""){
document.all("mycheck").style.display="";
document.form1.login_pwd.focus();
return false;
}
}
</script>

<body>
<!--#include file="../inc/top.asp"-->
<table width="960" style="border:#C6C6C6 solid 1px;" align="center" cellpadding="0" cellspacing="2">
<tr>
<td width="466" height="400" valign="middle"> <table width="96%" align="center" cellpadding="0" cellspacing="2" style="border:#C6C6C6 solid 1px;">
<form id="form1" name="form1" method="post" action="" onsubmit="return check_login()" >
<tr>
<td height="80" colspan="2" valign="top" style="padding-left:30px; padding-top:10px;"> <img src="../my_img/login.gif" width="281" height="42" /> </td>
</tr>
<tr>
<td width="26%" height="50" align="right" valign="middle" class="font16">Email: </td>
<td width="74%" align="left" valign="middle">   <input name=login_email class="input1" onfocus="this.className='input1-bor'" onblur="this.className='input1';" size="20" maxlength=40 /> </td>
</tr>
<tr>
<td width="26%" height="50" align="right" valign="middle" class="font16">密 码: </td>
<td width="74%" align="left" valign="middle">   <input name=login_pwd type="password" class="input1" onfocus="this.className='input1-bor'" onblur="this.className='input1';" size="20" maxlength=40 /> </td>
</tr>
<tr>
<td height="50" id="mycheck" colspan="2" align="center" valign="middle" style="padding-left:50px; display:none"> <div style="height:50px; width:200px; border: #f09 solid 1px; border-style:dotted;" id="div3" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50" align="center" class="font14">Email或密码错误 </td>
</tr>
</table>
</div> </td>
</tr>
<tr>
<td height="50" colspan="2" align="center">
<INPUT name="提交" type=submit class="buttonL_2 font14 pink weight700" value="登 陆">   <INPUT name="按钮" type=button class="buttonL_2 font14 pink weight700" onclick="go_url()" value="注 册"> </td>
</tr>

<tr>
<td height="50" colspan="2" align="center" class="font12"> <a href="#" class="thirdWhite">我忘记了密码 </a> </td>
</tr>
</form>
</table> </td>
<td width="488">  </td>
</tr>
</table>
<!--#include file="../inc/foot.asp"-->
</body>
</html>
...全文
116 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sy_binbin 2008-12-24
  • 打赏
  • 举报
回复
JS代码是页面加载或者点击才能执行的
wjp16351 2008-12-24
  • 打赏
  • 举报
回复
问题是我的那个什么地方出错了呢
wjp16351 2008-12-24
  • 打赏
  • 举报
回复
太谢谢你了..每次都是你帮我解决

sy_binbin 2008-12-24
  • 打赏
  • 举报
回复
if rs.eof and rs.bof then
%>
<script>
function aa()
{
document.all('mycheck').style.display='';
}
</script>
<%
rs.close
end if


然后在<body onload="aa()">

提供你一个思路

28,391

社区成员

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

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