怎样在ASP文本字段里,一回车自动输入<br>换行代码…但是不显示?

2024-11-23 01:52:18
推荐回答(2个)
回答1:

你是不是希望文本域里面的内容保存时,保持输入时的格式啊?保持时使用函数转换一下 HTMLencode(request("content"))Function HTMLEncode(str)
IF(str <> "")THEN
str = Replace(str, "&", "&")
str = Replace(str, ">", ">")
str = Replace(str, "<", "<")
str = Replace(str, Chr(32), " ")
str = Replace(str, Chr(9), " ")
str = Replace(str, Chr(34), """)
str = Replace(str, Chr(39), "'")
str = Replace(str, Chr(13), "")
str = Replace(str, Chr(10) & Chr(10), "

")
str = Replace(str, Chr(10), "
")
str = Replace(str, Chr(255), " ")
END IF
HTMLEncode = str
End Function

回答2:

知道怎么加了那还不是很简单的吗 一般可以有编辑的回答或者发贴的论坛都可以实现