Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jeby #1
Formatting Text Entered into a Text Area
I have a web application on a site I am working on that the staff can enter
their bio into and it posts it with their contact information.
The form is just a text box and a couple of hidden fields for userid and such.
If the user were to create paragraphs in the text area and save it to the
database the line breaks are not saved with it.
When the viewDetails.cfm page pulls the data from the database and inserts it
into the html of the page it creates a continuous block of text.
Is it possible to replace the line breaks in the text area with the
appropriate <br /> So that when the viewDetails.cfm page shows the data it can
render the page breaks?
I am having trouble deciding if i am explaining this clearly so if there are
any questions, please ask.
Thank you all!
Josh
jeby Guest
-
Coursebuilder - 5 text areas for 5 possible scores. Eachpossible answer has its own text area
I'm trying to build an inventory form that has different point values for each possible answer for a particular question. there will be 5 possible... -
Text Area formatting
Good morning, I have been experimenting with Flash /XML integration, using some of the various components in MX2004 Pro. Essentially my app pulls... -
text area resizing stretches inherent text
when i want to resize a text area the text in it stretches depending to the size. the result is ugly warped text (they are horizontally/vertically... -
Text in the work area vs. text in the Flash movie
Even when I use any font even the default _sans serif font, the size, scale and location of the letters are not the same in the published movie (or... -
[PHP] Input area allowing text formatting
http://www.interactivetools.com/products/htmlarea/ this is not concerning php but javascript -----Mensaje original----- De: Todd Cary Enviado... -
jmoshier #2
Re: Formatting Text Entered into a Text Area
If the information is added into the database with carriage returns you can use this function:
#Replace(fieldname,"#chr(10)#","<br>","all")#
jmoshier Guest
-
OldCFer #3
Re: Formatting Text Entered into a Text Area
You can also try:
<cfoutput>
<PRE> #TextField#</PRE>
</cfoutput>
OldCFer Guest
-
Stressed_Simon #4
Re: Formatting Text Entered into a Text Area
The carriage returns are actually saved in the database, it is just that HTML
considers all carriage returns and spaces to count as one space. So as jmoshier
rightly points out you can either use replace to add the break tags and insert
it into your database, or you can add the break tags when you output the each
profile. I would stump for the first of the two if I were you.
Stressed_Simon Guest
-
dempster #5
Re: Formatting Text Entered into a Text Area
You can use this function in your output:
ParagraphFormat(fieldname)
It will add a <P> tag to paragraph breaks in your text (CR/LF and then a blank
line and another CR/LF). You could tell users on the form to leave a blank line
between paragraphs.
The Replace option would also work if you want an HTML line break at all CR/LF
breaks in the text.
-Paul
dempster Guest
-
OldCFer #6
Re: Formatting Text Entered into a Text Area
I suggest you don't store the break tags in the database unless you're
absolutely sure
the data will never be used for anything but HTML display. If it needs to be
edited in a
text area or, accessed by another application, then all of those annoying
break tags will
be embedded in the text.
OldCFer Guest



Reply With Quote

