1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

又来请教了

本帖由 leehui19832006-03-27 发布。版面名称:前端开发

  1. leehui1983

    leehui1983 New Member

    注册:
    2006-02-26
    帖子:
    130
    赞:
    0
    请问如何让由文本框输入的文字能保持原样输出呢?我做的后台在添加新闻时,我在后台添文章,明明是分好段的,可是前台输出时就是全连在一起没分段的了?
    另外怎样设置文本域可插入超链接前台可直接点击超链接,还有在文本框输入时可自定义文字颜色呢?大家帮帮忙,尽量给个回答吧,谢谢!
     
  2. Tameway

    Tameway New Member

    注册:
    2005-09-06
    帖子:
    1,286
    赞:
    8
    将空格转换为&nbsp;,回车转换为<br>
     
  3. Tameway

    Tameway New Member

    注册:
    2005-09-06
    帖子:
    1,286
    赞:
    8
    例如取得字符串request("text"):
    strResult=replace(request("text")," ","&nbsp;")
    strResult=replace(request("text")," ","&nbsp;&nbsp;")
    strResult=replace(request("text"),chr(13),"&nbsp;")
     
  4. Tameway

    Tameway New Member

    注册:
    2005-09-06
    帖子:
    1,286
    赞:
    8
    动网里是这么写的

    function ubb(string)
    string = replace(string," ","&nbsp;")
    string = replace(string,"vbcrlf","<br>")
    ……
    ubb = string
    end function
     
  5. 风狼

    风狼 New Member

    注册:
    2005-10-01
    帖子:
    7,452
    赞:
    25
    你第二个问题我一般都是用插入在线编辑器完成的~~
     
  6. mj_wu

    mj_wu New Member

    注册:
    2006-03-26
    帖子:
    71
    赞:
    0
    楼上几个大哥都很强啊