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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Breaks into database

Status
Not open for further replies.

fatstu

Technical User
Feb 22, 2002
20
US
I know this isnt directly ASP but just wanted to know if anyone had the answer. I have a form on an asp where a people enter a lot of text. Inevitably they split up the data with new paragraphs. However, unless you physically enter <br><br> into the text field it does not display a line break on the output page. Does anyone know how to capture the use of the 'Return' button as <br> into the database?

 
Before putting it into the database you could do this:
Pretend your text field is name txtUserEntry

Dim entry
entry = Replace(Request.Form(&quot;txtUserEntry&quot;),vbCrLf,&quot;<br>&quot;)

That should replaces all line feeds with <br> tags. If you don't have vbCrLf defined, use the character code (sorry, don't remember it offhand, thats why I use vbCrLf :p )

Now insert entry into your db :)
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top