| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 611 人关注过本帖
标题:字段A等于字段B,写入提示,请问题如何表达?谢谢!
只看楼主 加入收藏
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
结帖率:79.07%
收藏
已结贴  问题点数:20 回复次数:5 
字段A等于字段B,写入提示,请问题如何表达?谢谢!
字段1:name  字段2:other

如果字段1:name等于李大刚,写入“李医生你好”
如果字段1:name等于苏大刚,写入“苏医生你好”
代码如下:
<%if rec("name")="李大刚" then%>李医生你好<%else%><%end if%>
<%if rec("name")="苏大刚" then%>苏医生你好<%end if%>

那么,如果<%=name%>=<%=other%>写入"<%=name%>",否则写入<%=other%>。又如何表示呢?

也就是说。如果name数据=other,写入name数据,否则写入other数据。


[ 本帖最后由 a190066 于 2012-8-2 01:17 编辑 ]
搜索更多相关主题的帖子: 如何 数据 你好 
2012-08-01 23:45
yjlwwl
Rank: 2
等 级:论坛游民
帖 子:5
专家分:33
注 册:2012-8-2
收藏
得分:10 
<% If name = other then
response.write name
else
response.write other
End If
%>
2012-08-02 23:15
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
收藏
得分:0 
回复 2楼 yjlwwl
万分感谢yjlwwl。你提供的代码
<% If name = other then
response.write name
else
response.write other
End If
%>可成功运行。但我想name = other 时,对name标注红色,以下代码无法运行,提示语法错误。特再向您请教,谢谢。<% If name = other then
response.write <b><font color=#FF0000>name</b></font>
else
response.write other
End If
%>


[ 本帖最后由 a190066 于 2012-8-3 15:47 编辑 ]
2012-08-03 01:35
kangli_kl
Rank: 6Rank: 6
等 级:侠之大者
威 望:2
帖 子:134
专家分:489
注 册:2008-4-5
收藏
得分:10 
<%if name = other then%>
<font color = red><%=name%></font>
<%else
response.write other
end if
%>

求上而得中,求中而得下。
2012-08-03 14:33
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
收藏
得分:0 
回复 4楼 kangli_kl
非常感谢您的解答,按你的代码测试结果如下:

代码没有提示错误,并能显示name和other值,但没有颜色。<font color = red><%=name%></font>这代码没有起作用,再次请教高手。
还有,name = other 时。以下代码无法跳转http://www.。只显示字段NoNoNo1 数据
<% If name = other then
response.redirect"http://www.("id")
else
response.write NoNoNo1
End If
%>是那里有错呢?

 

[ 本帖最后由 a190066 于 2012-8-3 15:47 编辑 ]
2012-08-03 15:01
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
收藏
得分:0 
问题已解决,谢谢高手的指点。。
<input name="NoNoNo1" size="51" style="border-style: solid; border-width: 1" onfocus=this.select() onmouseover=this.focus()  
rows=4 value="<%if rs("name")=rs("other") then
Response.Write Replace(rs("name"),rs("other"),"<font color=red>"&rs("other")&"</font>")
else
Response.Write rs("other")
end if%>">
2012-08-03 19:49
快速回复:字段A等于字段B,写入提示,请问题如何表达?谢谢!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015127 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved