Paragraph breaks in forms

E

EmmettPower

Hi,

I am building a small CMS for my son's school. Ideally I want to build
the system for them and hand it over so that all updates can be done
through web-based forms.

So far so good. However I'm having a problem with fields designed to
take multi-paragraph stories or articles. I'm using a text area field
on the form which saves the data in a memo field in the database.
Teachers would typically cut and paste stories from word documents into
the text area field.

However when the data is loaded back into the website from the database
all the carriage returns have been removed and the story consists of
one long paragraph.

I'd appreciate any suggestions for working around this problem and
preserving paragraph breaks.

Thanks in advance.


Emmett Power
 
H

Hal Rosser

Hi,

I am building a small CMS for my son's school. Ideally I want to build
the system for them and hand it over so that all updates can be done
through web-based forms.

So far so good. However I'm having a problem with fields designed to
take multi-paragraph stories or articles. I'm using a text area field
on the form which saves the data in a memo field in the database.
Teachers would typically cut and paste stories from word documents into
the text area field.

However when the data is loaded back into the website from the database
all the carriage returns have been removed and the story consists of
one long paragraph.

I'd appreciate any suggestions for working around this problem and
preserving paragraph breaks.

You just need to set the "wrap" attribute of the textarea tag to "hard".
You're not preserving "paragraph breaks" - you're preserving "newline" or
"carriage return" characters.
<textarea wrap="hard"> preserves text as it was pasted or typed into the
text area.
==== not as tough as you might have imagined =====
 
J

Jeff Cochran

You just need to set the "wrap" attribute of the textarea tag to "hard".
You're not preserving "paragraph breaks" - you're preserving "newline" or
"carriage return" characters.
<textarea wrap="hard"> preserves text as it was pasted or typed into the
text area.
==== not as tough as you might have imagined =====

Except that this also limits your options for the data. For example,
your textarea is set at 80 columns, and the data is viewed on a PDA.
Hard coded returns and breaks don't allow for flexibility.

Jeff
 

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

No members online now.

Forum statistics

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

Latest Threads

Top