473,324 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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

Jul 19 '05 #1
14 1484
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
Jul 19 '05 #2
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.

Jul 19 '05 #3
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

Jul 19 '05 #4
Thank you,but
newString = split(oldstring,"vbcrlf")

In my computer,this procedure is error.
I wait anyone's help

Jul 19 '05 #5
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" <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

Jul 19 '05 #6
> > newString = split(oldstring,"vbcrlf")

Lose the quotes...
newString = split(oldstring,vbcrlf)
Jul 19 '05 #7
<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 !
Jul 19 '05 #8
True...

Question : What is Microsoft MVP ?
bye bye

"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:uq**************@TK2MSFTNGP11.phx.gbl...
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" <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


Jul 19 '05 #9
> Ray at home
Microsoft ASP MVP


A little off topic, but... Congrats on the MVP :D
Jul 19 '05 #10
Thank you very much Randy. :]

Ray at work

"Randy Rahbar" <rvrahbar@_JUNKETY_JUNK_hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
Ray at home
Microsoft ASP MVP


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

Jul 19 '05 #11

"Kheops" <ga***********@kcc.com> wrote in message
news:10*************@corp.supernews.com...
True...

Question : What is Microsoft MVP ?


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
Jul 19 '05 #12
How do you become so ?
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:Ol**************@tk2msftngp13.phx.gbl...

"Kheops" <ga***********@kcc.com> wrote in message
news:10*************@corp.supernews.com...
True...

Question : What is Microsoft MVP ?

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

Jul 19 '05 #13
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" <ga***********@kcc.com> wrote in message
news:10*************@corp.supernews.com...
How do you become so ?
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:Ol**************@tk2msftngp13.phx.gbl...

"Kheops" <ga***********@kcc.com> wrote in message
news:10*************@corp.supernews.com...
True...

Question : What is Microsoft MVP ?


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


Jul 19 '05 #14
Thank you very much

Jul 19 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jack | last post by:
Hello, <%@ Language=VBScript %> <% Response.Write "<FORM name=form1>" Response.Write "<TEXTAREA rows=2 cols=20 id=textarea1 name=textarea1></TEXTAREA>" %> <Script language=JavaScript>...
4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
1
by: Volt | last post by:
is there any way to select and mark part of text in textarea by regular expression? i need to select the first string in textarea whitch is like xxxxx,xxx where x is any character
2
by: andymilk | last post by:
Greetings! I'm using a dropdown to set the value of a textarea to some text pulled from a database. This text is something like this: 单元 When I use a simple "document.write", it displays...
1
by: j_macaroni | last post by:
I found this code to calculate the caret position in a textarea. In the script getCaret below, I pass it the TextArea1 element. It seems to work until you press a CR. In which case you get the...
1
by: Garry Jones | last post by:
I have been using this code for sometime. I can use it to show the user how many remaining characters are reamaining in a text area. Now I need to develop the code and dont know where to start. ...
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
2
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the...
8
by: Sandy Tipper | last post by:
I have never had a textarea content change, in any browser. On several different projects. With javascript enabled (other stuff works.) I have read lots, and everyone says it should work. Can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.