如何用ASP在textarea中显示字段?

xierl 2004-12-03 05:11:32
<%
function HTMLEncode(fString)
if isnull(fString) then
HTMLEncode =""
exit function
end if
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
end function
%>

<p align="center"><font size="2" face="Geneva, Arial, Helvetica, san-serif">还需解决</font><font size="2" face="Geneva, Arial, Helvetica, san-serif"><br> 
<textarea name="jiejue" cols="60" rows="4" value= <% =HTMLEncode(objrs("还需解决")) %> ></textarea></font></p>
 显示出来的内容比实际少了一行?
...全文
218 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
AMinfo 2005-01-14
这个地方错了
<textarea name="jiejue" cols="60" rows="4" value= <% =HTMLDecode(objrs("还需解决")) %> ></textarea>
应该改成
<textarea name="jiejue" cols="60" rows="4"><% =HTMLDecode(objrs("还需解决")) %></textarea>
回复
xierl 2005-01-14
我都试过,不行,且是空白,没有把原文显示出来,若不换fString = Replace(fString, "<BR> ",chr(10)),显示出来的内容比实际少了一行(是头一行),跟我原程序显示的结果一样!请高手们继续指点!!!!
回复
wen1818 2004-12-03
function Deal(fString)
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString," ",chr(32))
fString = Replace(fString,""",chr(34))
fString = Replace(fString,"'",chr(39))
fString = Replace(fString, "", CHR(13))
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
Deal = fString
end function
回复
ygjwjj 2004-12-03
反替换试下:

<%
function HTMLDecode(fString)
if isnull(fString) then
HTMLDecode =""
exit function
end if
fString = replace(fString, ">",">")
fString = replace(fString, "<","<")
fString = Replace(fString, " ",chr(32))
fString = Replace(fString, " ",chr(9))
fString = Replace(fString, """,chr(34))
fString = Replace(fString, "'",chr(39))
//fString = Replace(fString, CHR(13), "")
fString = Replace(fString, "</P><P> ",chr(10)&chr(10))
fString = Replace(fString, "<BR> ",chr(10))
HTMLDecode = fString
end function
%>
<textarea name="jiejue" cols="60" rows="4" value= <% =HTMLDecode(objrs("还需解决")) %> ></textarea>
回复
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2004-12-03 05:11
社区公告
暂无公告