How can textarea's text with return

J

Jack

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
 
S

Stuart Palmer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top