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's text with return

Hello,
<%@ Language=VBScript %>
<%
Response.Write "<FORM name=form1>"
Response.Write "<TEXTAREA rows=2 cols=20 id=textarea1
name=textarea1></TEXTAREA>"
%>
<Script language=JavaScript>
document.form1.textarea1.value="ABC"&chr(13)&"DEF"
</Script>
<%
Response.Write "</FORM>"
%>
I want textarea1 shows:
ABC
DEF
But textarea1 shows none.
Thank you


  #2  
Old July 19th, 2005, 11:36 AM
Stuart Palmer
Guest
 
Posts: n/a
Default Re: How can textarea's text with return

try \n instead of chr(13).

<FORM name=form1>
<TEXTAREA rows=2 cols=20 id=textarea1 name=textarea1></TEXTAREA>
<Script language=JavaScript>
document.form1.textarea1.value="ABC\nDEF"
</Script>
</FORM>

The reason for this is because you are processing the JS outside the ASP script.

Hope this helps.

Stu

"Jack" <significance200310a@noyahoo.co.jp> wrote in message news:#xRI6PV6DHA.2264@tk2msftngp13.phx.gbl...[color=blue]
> Hello,
> <%@ Language=VBScript %>
> <%
> Response.Write "<FORM name=form1>"
> Response.Write "<TEXTAREA rows=2 cols=20 id=textarea1
> name=textarea1></TEXTAREA>"
> %>
> <Script language=JavaScript>
> document.form1.textarea1.value="ABC"&chr(13)&"DEF"
> </Script>
> <%
> Response.Write "</FORM>"
> %>
> I want textarea1 shows:
> ABC
> DEF
> But textarea1 shows none.
> Thank you
>
> [/color]

  #3  
Old July 19th, 2005, 11:36 AM
Jack
Guest
 
Posts: n/a
Default Re: How can textarea's text 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