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!

Text formatting in submit form 2

Status
Not open for further replies.

auger

Technical User
Oct 27, 2001
48
CA
I have a form that posts news articles to an Access DB. I have an ASP page that pulls the last 5 articles from the DB and displays them on a main news page, along with headline, posted by & date posted.

I have a problem with the text stringing together. I want to be able to post news articles in paragraph format...as it stands, all my sentences string together as if they are one big paragraph.

Any simple tips to set this straight?

 
Auger,

Code:
<%=textstring1%><br><br><%=textstring2%><br><br><%=textstring3%>

Or are you trying to break up one very long string ??

ToddWW :)
 
Well, it's the same form you helped me with on Sunday (and thanks again!).

The form posts to the db in a text box just like the one I'm typing in right now. As you know, we can format the text a little by breaking up our paragraphs. This is the second paragraph for instance.

This is the third. What I'm trying to achieve is to input my text in paragraphs like this and retrieve the data from my DB in the same format, preferably without having to code html into the input text area. The person who will be updating the articles knows even less code than I do(if you can believe it).

What I'm getting now looks like this>>>


Well, it's the same form you helped me with on Sunday (and thanks again!). The form posts to the db in a text box just like the one I'm typing in right now. As you know, we can format the text a little by breaking up our paragraphs. This is the second paragraph for instance. This is the third. What I'm trying to achieve is to input my text in paragraphs like this and retieve the data from my DB in the same format, preferably without having to code html into the input text area. The person who will be updating the articles knows even less code than I do(if you can believe it). What I'm getting now looks like this>>>Yuck.

 
all you gotta is, is embed your article text in <PRE> and you will be extra super duper happy!

great!
 
Oh, I see now. You can do that by using JavaScript to replace the carriage returns/line feeds in the <textarea> to <br> before submitting the data to the database. That way when you re-write to the web page, the <br>'s will be tranlated into line breaks, or new paragraphs. Of course, I don't know the exact syntax for this, but I would suggest that you post the following to the JavaScript forum.

Subject: Converting CR to <br> in Javascript.
Content: I would like to convert the carriage returns in my <textarea> to <br> before submitting to the database so when I re-write the data to the webpage, my paragraphs will be formatted correctly.

You'll get a response within minutes to that.

Hope this helps :)

ToddWW
 
Thank you both. Very useful info. It's always good to have alternatives.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top