文本框的内容多了,我怎样才显回的时候不全显(显示一些后其他省略)啊???

Dadimamiilove 2009-10-04 10:56:01
<textarea name="textarea" id="textarea" cols="165" rows="5"></textarea>
...全文
154 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
taoistong 2009-10-04
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 hookee 的回复:]
HTML code<%
...
content= rs("content").value

n=0
total=165*5For i=1ToLen(content)
c=Mid(content,i,1)
a=Asc(c)If a>=0And a<128Then
n= n+1Else
n= n+2EndIfNextIf n> totalThen
conten¡­
[/Quote]


正解
或者sql查询时候处理一下

select substring(字段,1,5)+'.........'
也可以
hookee 2009-10-04
  • 打赏
  • 举报
回复
<%
...
content = rs("content").value

n = 0
total = 165 * 5
For i=1 To Len(content)
c = Mid(content,i,1)
a = Asc(c)
If a>=0 And a<128 Then
n = n + 1
Else
n = n + 2
End If
Next

If n > total Then
content = Left(content, total-6) & "......"
End If
%>
<textarea name="textarea" id="textarea" cols="165" rows="5">
<%=content%>
</textarea>

28,406

社区成员

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

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