Connecting Tech Pros Worldwide Forums | Help | Site Map

How can textarea shows value with return

Jack
Guest
 
Posts: n/a
#1: Jul 19 '05
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


Kheops
Guest
 
Posts: n/a
#2: Jul 19 '05

re: How can textarea shows value with return


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


Jack
Guest
 
Posts: n/a
#3: Jul 19 '05

re: How can textarea shows value with return


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.

Kheops
Guest
 
Posts: n/a
#4: Jul 19 '05

re: How can textarea shows value with return


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" <significance200310a@noyahoo.co.jp> wrote in message
news:uCybclX6DHA.2044@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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[/color]
field.[color=blue]
> But this field has returns.That is to say
> shipmentTable("Specification")="abc
> edf
> ghi"
> textarea1 cannot shows shipmentTable("Specification")'s value.it shows[/color]
none.[color=blue]
> Thank you
>[/color]


Jack
Guest
 
Posts: n/a
#5: Jul 19 '05

re: How can textarea shows value with return


Thank you,but[color=blue]
> newString = split(oldstring,"vbcrlf")[/color]
In my computer,this procedure is error.
I wait anyone's help

Ray at
Guest
 
Posts: n/a
#6: Jul 19 '05

re: How can textarea shows value with return


Why are you assigning the value to the text area using client side code like
that? That defeats half the purpose of ASP.

<%
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")
' http://www.aspfaq.com/show.asp?id=2424
shipmentTable.Close : Set shipmentTable = Nothing
shipment_db.Close : Set shipment_db = Nothing

%>

<FORM name=form1>
<TEXTAREA rows=4 cols=20 id=textarea1 name=textarea1><%=y%></TEXTAREA>
</form>


--

Ray at home
Microsoft ASP MVP


"Jack" <significance200310a@noyahoo.co.jp> wrote in message
news:uCybclX6DHA.2044@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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[/color]
field.[color=blue]
> But this field has returns.That is to say
> shipmentTable("Specification")="abc
> edf
> ghi"
> textarea1 cannot shows shipmentTable("Specification")'s value.it shows[/color]
none.[color=blue]
> Thank you
>[/color]


Randy Rahbar
Guest
 
Posts: n/a
#7: Jul 19 '05

re: How can textarea shows value with return


> > newString = split(oldstring,"vbcrlf")

Lose the quotes...
newString = split(oldstring,vbcrlf)


Kheops
Guest
 
Posts: n/a
#8: Jul 19 '05

re: How can textarea shows value with return


<HTML>
<BODY>
<%
Dim chaine
Dim caractere
Dim tableau

chaine = "A!B!C"
tableau = split(chaine,"!")

Response.Write(tableau(0)) 'This prints A on screen
%>
</BODY>
</HTML>


This works great !
Now you just have to browse your array !


Kheops
Guest
 
Posts: n/a
#9: Jul 19 '05

re: How can textarea shows value with return


True...

Question : What is Microsoft MVP ?


bye bye

"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:uq0vU0Y6DHA.2576@TK2MSFTNGP11.phx.gbl...[color=blue]
> Why are you assigning the value to the text area using client side code[/color]
like[color=blue]
> that? That defeats half the purpose of ASP.
>
> <%
> 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")
> ' http://www.aspfaq.com/show.asp?id=2424
> shipmentTable.Close : Set shipmentTable = Nothing
> shipment_db.Close : Set shipment_db = Nothing
>
> %>
>
> <FORM name=form1>
> <TEXTAREA rows=4 cols=20 id=textarea1 name=textarea1><%=y%></TEXTAREA>
> </form>
>
>
> --
>
> Ray at home
> Microsoft ASP MVP
>
>
> "Jack" <significance200310a@noyahoo.co.jp> wrote in message
> news:uCybclX6DHA.2044@TK2MSFTNGP10.phx.gbl...[color=green]
> > 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[/color][/color]
ID[color=blue][color=green]
> > =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[/color]
> field.[color=green]
> > But this field has returns.That is to say
> > shipmentTable("Specification")="abc
> > edf
> > ghi"
> > textarea1 cannot shows shipmentTable("Specification")'s value.it shows[/color]
> none.[color=green]
> > Thank you
> >[/color]
>
>[/color]


Randy Rahbar
Guest
 
Posts: n/a
#10: Jul 19 '05

re: How can textarea shows value with return


> Ray at home[color=blue]
> Microsoft ASP MVP[/color]

A little off topic, but... Congrats on the MVP :D


Ray at
Guest
 
Posts: n/a
#11: Jul 19 '05

re: How can textarea shows value with return


Thank you very much Randy. :]

Ray at work

"Randy Rahbar" <rvrahbar@_JUNKETY_JUNK_hotmail.com> wrote in message
news:uNW34Qa6DHA.2576@TK2MSFTNGP11.phx.gbl...[color=blue][color=green]
> > Ray at home
> > Microsoft ASP MVP[/color]
>
> A little off topic, but... Congrats on the MVP :D
>
>[/color]


Ray at
Guest
 
Posts: n/a
#12: Jul 19 '05

re: How can textarea shows value with return



"Kheops" <gaetan.allart@kcc.com> wrote in message
news:101sruhk7jrqtf3@corp.supernews.com...[color=blue]
> True...
>
> Question : What is Microsoft MVP ?
>[/color]

Someone who didn't get enough work done last year because he spent too much
time in newsgroups. :] See here. www.microsoft.com/mvp

Ray at work


Kheops
Guest
 
Posts: n/a
#13: Jul 19 '05

re: How can textarea shows value with return


How do you become so ?


"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:OlaAYWa6DHA.2996@tk2msftngp13.phx.gbl...[color=blue]
>
> "Kheops" <gaetan.allart@kcc.com> wrote in message
> news:101sruhk7jrqtf3@corp.supernews.com...[color=green]
> > True...
> >
> > Question : What is Microsoft MVP ?
> >[/color]
>
> Someone who didn't get enough work done last year because he spent too[/color]
much[color=blue]
> time in newsgroups. :] See here. www.microsoft.com/mvp
>
> Ray at work
>
>[/color]


Ray at
Guest
 
Posts: n/a
#14: Jul 19 '05

re: How can textarea shows value with return


http://mvp.support.microsoft.com/def...;EN-US;mvpfaqs Or
better, read the part in the bordered table here.
http://www.mvps.org/about/

Ray at work


"Kheops" <gaetan.allart@kcc.com> wrote in message
news:101su2c483ths3d@corp.supernews.com...[color=blue]
> How do you become so ?
>
>
> "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
> message news:OlaAYWa6DHA.2996@tk2msftngp13.phx.gbl...[color=green]
> >
> > "Kheops" <gaetan.allart@kcc.com> wrote in message
> > news:101sruhk7jrqtf3@corp.supernews.com...[color=darkred]
> > > True...
> > >
> > > Question : What is Microsoft MVP ?
> > >[/color]
> >
> > Someone who didn't get enough work done last year because he spent too[/color]
> much[color=green]
> > time in newsgroups. :] See here. www.microsoft.com/mvp
> >
> > Ray at work
> >
> >[/color]
>
>[/color]


Jack
Guest
 
Posts: n/a
#15: Jul 19 '05

re: How can textarea shows value with return


Thank you very much

Closed Thread


Similar ASP / Active Server Pages bytes