textarea如何通过返回显示价值 [英] How can textarea shows value with return
问题描述
你好,
<%@ Language = VBScript%>
<%
Response.Write"< FORM name = form1>"
设置shipment_db = Server.CreateObject(" ADODB.Connection")
shipment_db.Open" shipping"
设置shipmentTable = shipment_db.Execute(" SELECT * FROM shipment WHERE ID
= 39")
y = shipmentTable(" Specification")
Response.Write"< TEXTAREA rows = 4 cols = 20 id = textarea1
name = textarea1>< / TEXTAREA>"
%>
<脚本语言= JavaScript>
document.form1.textarea1.value ="<%= y%>"
< / Script>
<%
Response.Write"< / FORM>"
%>
货件是Microsoft Access的表格,规格是这个表格的字段。
但是这个字段有退货。也就是说
shipmentTable(QUOT;规格及QUOT;)=" ; abc
edf
ghi"
textarea1无法显示shipmentTable(" Specification")'的value.it显示无。
谢谢
在我看来,
你必须将返回的字符串中的vbcrlf字符替换为< br> ;.
可能存在为您执行此操作的ASP函数:strreplace或replace,
我不记得了。
=> newString = replace(orldString,vbcrlf,"< br>")
让我知道它是否有效
< blockquote>谢谢,
使用newString = replace(oldString,vbcrlf,"< br>")
textarea可以显示value.But oldString''返回更改为< br>。
也就是说:
如果oldString =" ABC
DEF
GHI"
textarea显示ABC< br> DEF< br> GHI。
我等待任何人的帮助。
我刚尝试过,
事实上,你必须在ASP代码中使用vbcrlf命令
我的意思是:
response.write(" A& vbcrlf&"" B")
很棒!
所以你需要的是拆分你返回的记录集。
newString = split(oldstring," vbcrlf" )
现在
对于newstring中的每个字符
response.write(char& vbcrlf)
next
试试吧,让我知道
" Jack" < SI ***************** @ noyahoo.co.jp>在消息中写道
news:uC ************** @ TK2MSFTNGP10.phx.gbl ...你好,><%@ Language = VBScript%>
<%
Response.Write"< FORM name = form1>"
设置shipment_db = Server.CreateObject(" ADODB .Connection")
shipment_db.Open" shipping"
设置shipmentTable = shipment_db.Execute(" SELECT * FROM shipment WHERE ID
= 39")
y = shipmentTable( 规范)
Response.Write"< TEXTAREA rows = 4 cols = 20 id = textarea1
name = textarea1>< / TEXTAREA>"
%>
<脚本语言= JavaScript>
document.form1.textarea1.value ="<%= y%>"
< / Script>
<%<响应。写入"< / FORM>"
%>
货件是Microsoft Access的表格,规格是此表格的
字段。但是这个字段有返回。也就是说
shipmentTable(" Specification")=" abc
edf
ghi"
textarea1无法显示shipmentTable(" Specification") 's value.it显示
无。谢谢
Hello,
<%@ Language=VBScript %>
<%
Response.Write "<FORM name=form1>"
Set shipment_db = Server.CreateObject("ADODB.Connection")
shipment_db.Open "shipment"
Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment WHERE ID
=39")
y=shipmentTable("Specification")
Response.Write "<TEXTAREA rows=4 cols=20 id=textarea1
name=textarea1></TEXTAREA>"
%>
<Script language=JavaScript>
document.form1.textarea1.value="<%=y%>"
</Script>
<%
Response.Write "</FORM>"
%>
shipment is a Microsoft Access''s table,Specification is this table''s field.
But this field has returns.That is to say
shipmentTable("Specification")="abc
edf
ghi"
textarea1 cannot shows shipmentTable("Specification")''s value.it shows none.
Thank you
In my mind,
you have to replace the vbcrlf characters in your returned string to <br>.
There may exist an ASP function that do it for you : strreplace or replace,
I don''t remember.
=> newString = replace(orldString,vbcrlf,"<br>")
Let me know if it works or not
Thank you,
use newString = replace(oldString,vbcrlf,"<br>")
The textarea can show value.But oldString''s return be changed to "<br>".
That is to say:
if oldString="ABC
DEF
GHI"
The textarea shows "ABC<br>DEF<br>GHI".
I wait anyone''s help.
I just tried it,
And in fact, you have to use the vbcrlf command inside ASP code
I mean :
response.write("A" & vbcrlf & "B")
works great !
So what you need is to split you returned recordset.
newString = split(oldstring,"vbcrlf")
and now
for each char in newstring
response.write(char & vbcrlf)
next
Try it and let me know
"Jack" <si*****************@noyahoo.co.jp> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...Hello,
<%@ Language=VBScript %>
<%
Response.Write "<FORM name=form1>"
Set shipment_db = Server.CreateObject("ADODB.Connection")
shipment_db.Open "shipment"
Set shipmentTable = shipment_db.Execute("SELECT * FROM shipment WHERE ID
=39")
y=shipmentTable("Specification")
Response.Write "<TEXTAREA rows=4 cols=20 id=textarea1
name=textarea1></TEXTAREA>"
%>
<Script language=JavaScript>
document.form1.textarea1.value="<%=y%>"
</Script>
<%
Response.Write "</FORM>"
%>
shipment is a Microsoft Access''s table,Specification is this table''s field. But this field has returns.That is to say
shipmentTable("Specification")="abc
edf
ghi"
textarea1 cannot shows shipmentTable("Specification")''s value.it shows none. Thank you
这篇关于textarea如何通过返回显示价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!