Solved

Coldfusion cftexarea (richtext=true) alignment issue

Posted on 2007-11-29
2
183 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
Comment Utility
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
Comment Utility
That's a reasonable work around thanks =)
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

744 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