473,382 Members | 1,355 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,382 software developers and data experts.

Inserts HTML line breaks before all newlines in a string

Hey,

If i'am writing a post in a "textarea" and i use the ENTER (newline) on my keyboard it comes as a line break <br> in my post on the forum.

PHP uses "nl2br", but what is the ASP solution for this?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28-Sep-2004
Jul 19 '05 #1
3 1533
On Thu, 30 Sep 2004 08:02:11 -0400, "Chris Mach" <cj****@gto.net>
wrote:
If i'am writing a post in a "textarea" and i use the ENTER (newline) on my keyboard it comes as a line break <br> in my post on the forum.

PHP uses "nl2br", but what is the ASP solution for this?


Depends on wht you actually want, but this may be what the equivalent
to PHP would be:

strPost = Replace(FormInput,VbCrLf,"<br>")

FormInput is what comes from the text area, strPost is the post with
HTML breaks.

Personally, I store the text verbatim in the database and replace on
retrieving it, but it could work either way.

Jeff
Jul 19 '05 #2
Personally, I store the text verbatim in the database and replace on
retrieving it, but it could work either way.


Yes, that is what I want to do, how is that done?

please? :D
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28-Sep-2004
Jul 19 '05 #3
On Thu, 30 Sep 2004 08:46:00 -0400, "Chris Mach" <cj****@gto.net>
wrote:
Personally, I store the text verbatim in the database and replace on
retrieving it, but it could work either way.


Yes, that is what I want to do, how is that done?


Are you asking how to save a text input field to a database field,
retrieve the data from the database, format it for display or all of
the above?

Might look at:

http://www.1asphost.com/asp_db.asp

It's not perfect, but will get you started.

Jeff
Jul 19 '05 #4

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

Similar topics

7
by: S Borg | last post by:
Hello, I am parsing text from one document to another. I have a scheme similar to: for x in myfoobar: print >> mytextfile, "%s " % mydictionary, #all on same line print >> mytextfile,...
5
by: Thomas Heiz | last post by:
I want to create a html email with c# and the class System.Web.Mail. The assign html code is correct, but the produced email has a lot of strange errors in the text. there are ! in the text,...
9
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want...
2
by: pittendrigh | last post by:
I have a home-rolled forum, written in php, based on some old cgi code written by a guy named David Turely. Works just fine. However, when reading user-supplied input I use 'addslashes' to...
3
by: nashak | last post by:
Hello, In a Stored Proc, I am building a string variable. I am getting outputs from 4 different queries and would like the string to have line breaks to display each entry in a different line in...
15
by: pkirk25 | last post by:
I have a file with roughly 1000 lines that I cannot allow the user to read but which I want to use in my project. I thought I could copy it into one huge string variable but that won't work...
11
by: rossum | last post by:
I want to declare a const multi-line string inside a method, and I am having some problems using Environment.NewLine. I started out with: class foo { public void PrintStuff() { const...
14
by: ghostwalker | last post by:
Hi I have an HTML form with a textarea on it. When submitted (using 'get' not 'post') this forms action php file simply does this to retrieve the values: $message = $_GET; Now it all works...
13
by: programming | last post by:
how do i delete from a text file 1 of the following lines: jon|scott adam|smith <--delete paul|clark say i would like to delete the middle line of this txt, in member.txt what php code or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.