Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 11:36 AM
Jack
Guest
 
Posts: n/a
Default How can textarea shows value with return

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

  #2  
Old July 19th, 2005, 11:36 AM
Kheops
Guest
 
Posts: n/a
Default 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


  #3  
Old July 19th, 2005, 11:36 AM
Jack
Guest
 
Posts: n/a
Default 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.

  #4  
Old July 19th, 2005, 11:36 AM
Kheops
Guest
 
Posts: n/a
Default 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]


  #5  
Old July 19th, 2005, 11:36 AM
Jack
Guest
 
Posts: n/a
Default 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

  #6  
Old July 19th, 2005, 11:36 AM
Ray at
Guest
 
Posts: n/a
Default 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]


  #7  
Old July 19th, 2005, 11:37 AM
Randy Rahbar
Guest
 
Posts: n/a
Default Re: How can textarea shows value with return

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

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


  #8  
Old July 19th, 2005, 11:37 AM
Kheops
Guest
 
Posts: n/a
Default 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 !


  #9  
Old July 19th, 2005, 11:37 AM
Kheops
Guest
 
Posts: n/a
Default 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]


  #10  
Old July 19th, 2005, 11:37 AM
Randy Rahbar
Guest
 
Posts: n/a
Default 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


  #11  
Old July 19th, 2005, 11:37 AM
Ray at
Guest
 
Posts: n/a
Default 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]


  #12  
Old July 19th, 2005, 11:37 AM
Ray at
Guest
 
Posts: n/a
Default 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


  #13  
Old July 19th, 2005, 11:37 AM
Kheops
Guest
 
Posts: n/a
Default 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]


  #14  
Old July 19th, 2005, 11:37 AM
Ray at
Guest
 
Posts: n/a
Default 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]


  #15  
Old July 19th, 2005, 11:38 AM
Jack
Guest
 
Posts: n/a
Default Re: How can textarea shows value with return

Thank you very much

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles