如何让空格回车输入到数据库 10
<formid="form1"name="form1"method="POST"action="<%=MM_editAction%>"><p> </p><tab...
<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
<p> </p>
<table width="748" height="475" border="1" cellspacing="0">
<tr>
<td width="112" height="23"><span class="STYLE2">新闻标题:</span></td>
<td width="626"><label>
<input name="textfield" type="text" size="85" />
</label></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">发布人:</span></td>
<td><label>
<input name="textfield2" type="text" size="85" />
</label></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">发布时间:</span></td>
<td><label>
<input name="textfield3" type="text" onblur="YY_checkform('form1','textfield3','^\([0-9]{4}\)\\-\([0-9][0-9]\)\\-\([0-9][0-9]\)$#3#2#1','3','日期格式为****-**-**');return document.MM_returnValue" size="85" />
</label></td>
</tr>
<tr>
<td height="300"><span class="STYLE2">新闻内容:</span></td>
<td><label>
<textarea name="textfield4" cols="85" rows="20" wrap="virtual" height="300"></textarea>
</label></td>
</tr>
</table>
<div align="center">
<table width="200" border="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label>
<input type="submit" name="Submit" value="添 加" />
</label></td>
<td><label>
<input type="reset" name="Submit2" value="重 置" />
</label></td>
</tr>
</table>
</div>
<p> </p>
<p> </p>
<input type="hidden" name="MM_insert" value="form1">
</form><!--#include file="../../Connections/cnn.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
我在新闻内容文本框里输入新闻添加到数据库,但是在另一个页面输出的时候,不会显示回车换行。我查了一下要加转换代码 才行,但是我的网页是用dreamweaver生成的,我不知道加在什么地方,请各位大虾帮帮忙。 展开
<p> </p>
<table width="748" height="475" border="1" cellspacing="0">
<tr>
<td width="112" height="23"><span class="STYLE2">新闻标题:</span></td>
<td width="626"><label>
<input name="textfield" type="text" size="85" />
</label></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">发布人:</span></td>
<td><label>
<input name="textfield2" type="text" size="85" />
</label></td>
</tr>
<tr>
<td height="25"><span class="STYLE2">发布时间:</span></td>
<td><label>
<input name="textfield3" type="text" onblur="YY_checkform('form1','textfield3','^\([0-9]{4}\)\\-\([0-9][0-9]\)\\-\([0-9][0-9]\)$#3#2#1','3','日期格式为****-**-**');return document.MM_returnValue" size="85" />
</label></td>
</tr>
<tr>
<td height="300"><span class="STYLE2">新闻内容:</span></td>
<td><label>
<textarea name="textfield4" cols="85" rows="20" wrap="virtual" height="300"></textarea>
</label></td>
</tr>
</table>
<div align="center">
<table width="200" border="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label>
<input type="submit" name="Submit" value="添 加" />
</label></td>
<td><label>
<input type="reset" name="Submit2" value="重 置" />
</label></td>
</tr>
</table>
</div>
<p> </p>
<p> </p>
<input type="hidden" name="MM_insert" value="form1">
</form><!--#include file="../../Connections/cnn.asp" -->
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
我在新闻内容文本框里输入新闻添加到数据库,但是在另一个页面输出的时候,不会显示回车换行。我查了一下要加转换代码 才行,但是我的网页是用dreamweaver生成的,我不知道加在什么地方,请各位大虾帮帮忙。 展开
展开全部
不明白,直接保存到数据库里就可以了..现在的问题现象是什么.
将录入内容,用
textfield4=replace(request("textfield4"),"\n","<br>")
textfield4=replace(request("textfield4")," "," ")
在保存到数据库里就可以了.
将录入内容,用
textfield4=replace(request("textfield4"),"\n","<br>")
textfield4=replace(request("textfield4")," "," ")
在保存到数据库里就可以了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询