如何判断一个字段为空?谢谢

laoziguan 2005-05-26 11:41:54
请问各位高手,我在用Javascript写的ASP程序里,判断一个字段为空有几种写法?我写的
<td class="biaoge"><div align="center"><%
if(rs("unstuffing_date")!="")
{Response.Write(rs("unstuffing_date"))}
else
{Response.Write("not yet")}
%></div></td>
这样写,错倒是不报,就是输出一片空白,什么都没有。请问各位是否还有别的写法?(javascript)
...全文
100 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dixing 2005-05-26
  • 打赏
  • 举报
回复
在ASP中用<>代替不等号阿..........
baikaishui_0825 2005-05-26
  • 打赏
  • 举报
回复
<%
if(isnull(rs("unstuffing_date"))=false) then
Response.Write(rs("unstuffing_date"))
else
Response.Write("not yet")
end if
%>
king2410 2005-05-26
  • 打赏
  • 举报
回复
你语法都错了
<td class="biaoge"><div align="center">
<script>if('<%=rs("unstuffing_date")%>'!='')
{document.Write('<%=rs("unstuffing_date")%>')}
else
{document.Write("not yet")}</script>
</div></td>
或者
<td class="biaoge"><div align="center"><%
if rs("unstuffing_date") <> "" and not IsNull(rs("unstuffing_date")) and not IsEmpty(rs("unstuffing_date")) then
Response.Write rs("unstuffing_date")
else
Response.Write("not yet")
end if
%></div></td>
jzywh 2005-05-26
  • 打赏
  • 举报
回复
vbscript

IsNull(rs(0))
langzi520 2005-05-26
  • 打赏
  • 举报
回复
呵呵
楼主还得好好学了!

28,406

社区成员

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

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