| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 410 人关注过本帖
标题:字段name数据等于字段other时,如何把字段other数据或字段name数据标注红色 ...
只看楼主 加入收藏
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
结帖率:79.07%
收藏
已结贴  问题点数:20 回复次数:3 
字段name数据等于字段other时,如何把字段other数据或字段name数据标注红色呢?
如果字段name数据等于李生时,可以把李生标注红色。代码如下:

<%if rs("name")="李生" then%>
<font color="red"><%=rs("name")%></font><%else%><%=rs("name")%><%end if%>

但如果字段name数据等于字段other时,如何把字段other数据或字段name数据标注红色呢?
搜索更多相关主题的帖子: 如何 
2012-08-03 13:18
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:20 
你说的是搜索引擎关键字标红色吗?
Response.Write Replace(rs("othre"),rs("name"),"<font color=red >"&rs("name")&"</font>")
使用Replace函数进行替换
2012-08-03 16:34
a190066
Rank: 4
等 级:业余侠客
威 望:2
帖 子:175
专家分:204
注 册:2010-6-24
收藏
得分:0 
回复 2楼 yms123
<td><%=rs("name1")%></td>
<td><%if rs("name")="李生" then%>'如果name=李生,李生就是红色的字体。如果不是李生是一个段other又如何表达
<font color="red"><%=rs("name")%></font><%else%><%=rs("name")%><%end if%></td>
2012-08-03 18:16
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:48
快速回复:字段name数据等于字段other时,如何把字段other数据或字段name数据标注 ...
数据加载中...
 
   



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

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