Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I insert line break into a TextArea control

Status
Not open for further replies.

Ken011

MIS
Oct 13, 2006
66
US
Greetings everyone,

This is probably a cheap one, for that I apologize.

I will like to insert a br into a textArea so that when I hit then return key, the next text begins on a new line.

So far, everying is wrapping naturally which is fine but I want to be able to begin a new paragraph on a new line.

Can someone please help?

Code:
Comments: <textarea cols="20" rows="8" name="comments" maxlength="200" WRAP="Virtual"> </textarea>

thanks much in advance
 
Add chr(13) where you want a newline eg
Code:
comments.value = _
"When shall we three meet again" & chr(13) &_
"In thunder lightning or in rain"
 
to be complete :
<% comment = "take a break..." & chr(13) & chr(10) & "and begin a new line" %>
chr(10) takes a linefeed
chr(13) takes a carriage Return
 
Tip: You can use [tt][red]vbCrLf[/red][/tt] as a shortcut for [tt]chr(13) & chr(10)[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top