Solved

Coldfusion cftexarea (richtext=true) alignment issue

Posted on 2007-11-29
2
184 Views
Last Modified: 2008-09-16
When text is written inside a cftextarea and end-of-line is entered, and the source is viewed it appears within a <p> block. Due to subsequent processes it was neccessary for me to change fckconfig.js which configures this to make </br> the default function of the ENTER key.

However, the problem i get now is that <p> is ALSO submitted when the text is aligned. If i write some text, and align it in any way it is embedded within some <p> block, i.e:

<p align="justify">some text</p>

.. is there a way to configure, such as there was for the enter key, which tag should be used for alignment? .. ideally i would like to use <div align="justify"> since the subsequent process does not perform any formatting on <div> tags>>
0
Comment
Question by:paddycobbett
2 Comments
 
LVL 18

Accepted Solution

by:
Plucka earned 500 total points
ID: 20379911
I would suggest that rather than modifying the fckconfig.js I would accept how it renders things, then afterwards alter the result using CF RegEx's.

Sounds like you have a problem on rendering the content, so just store it verbatim, and only change it to how you want it to work when you want to render it.

A simple non regex version of this might be
<cfset myContent = replace(myContent, "<p>", "<br />", "all") />

<cfset myContent = replace(myContent, "</p>, "<br /><br />, "all") />

Open in new window

0
 
LVL 1

Author Comment

by:paddycobbett
ID: 20384107
That's a reasonable work around thanks =)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now