Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using TINYMCE

Explorer ,
Mar 25, 2007 Mar 25, 2007
I am using tinyMCe with my textareas, they are working fine and in am entering the message as i like the way formatted, When they appear on the below page. It shows the HTML tags and didi not display my Formatting, The way it comes out is like this:

<h1>I think sql server 2005 is stable than others.</h1><p style="background-color: #ff6600"><img src="../tinyMCE/plugins/emotions/images/smiley-undecided.gif" border="0" alt="Undecided" title="Undecided" /> </p>

Well I hope this need to be resolved...

I also try surrounding your output with
<cfcontent type="text/html">

It is just making my template look bad and not shown the way it should be shown as formatted.
.

This probably didnt worked out...
7.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2007 Mar 25, 2007
tinyMCE does not like poorly formated code. Review your code for correct formatting, mabe use http://validator.w3.org/ to validate it.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 25, 2007 Mar 25, 2007
quote:

Originally posted by: Neo Rye
tinyMCE does not like poorly formated code. Review your code for correct formatting, mabe use http://validator.w3.org/ to validate it.


Well I cheked this, but did not find any relevant information, well what is it and how can i find the specific info about the tinyMCE formatting
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 25, 2007 Mar 25, 2007
how do you output the info? can you post the code?

--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 25, 2007 Mar 25, 2007
Is your output inside a textarea?

Try placing it in a div instead of a textarea as textarea controls don't display formatted html.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2007 Mar 26, 2007
Well the code is below which is troubling me..

I have configured the tinymce with the following script as it is appearing:


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 26, 2007 Mar 26, 2007
i am a bit confused re what you've posted...
the init script looks fine, but what's that after the last </script>???
where is that coming from? can you post the actual code you are using in
your page to display what has previously been entered into a
TinyMCE-controlled textarea?

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2007 Mar 26, 2007
quote:

<p>Sql is the only tool which is best running and it can be configured with anyone technologylike:</p><p>Coldfusion</p><p>PHP/ASP.NET </p><p>The sql server 2000 is still used very much, it is a great tool and many enterprises are still using it, you can have a look in the <a href=" http://www.google.co.in/search?hl=en&q=sql+server+2000&btnG=Google+Search&meta=" target="_blank" title="Sql Server" onclick="window.open('','','');return false;">google</a> page for a link regarding the sql server 2000.</p><p><img src="../tinyMCE/plugins/emotions/images/smiley-laughing.gif" border="0" alt="Laughing" title="Laughing" /> </p>10:37:22




I think you are taking about this:, sory i missed the explanation. this is the output which is generated by the tinymce. it does not show the HTML formated as i enter in tinymce but it show up like the above...

Hope you gets what i am looking for..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 26, 2007 Mar 26, 2007
not really... what do you mean by:
> this is the output which is generated by the tinymce.
???

HOW do you output it? inside another textarea field? from a database?
from another text/html/cfm file? where does tinymce store the input? how
do you retrieve it? can you post the actual CODE you use to show the
output on screen?

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2007 Mar 26, 2007
ok here is the file which contains the fields which fill the info as:

<script src="../tinyMCE/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
plugins : 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras',
themes : 'simple,advanced',
languages : 'en',
disk_cache : true,
debug : false
});
</script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>
<cfif Not IsDefined("session.User.LoggedIn")>
<div align="center">Please register Yourself to Post a Reply...</div>
<meta http-equiv="refresh" content="20;URL=../index.cfm" />
<cfelse>
<link href="../Blogs/style_blogs.css" rel="stylesheet" type="text/css" />
<body>
<TABLE WIDTH="613" BORDER="0" align="center" CELLPADDING="2" CELLSPACING="0">
<CFFORM ACTION="action.cfm?action=post">
<TR>
<TD colspan="2" ALIGN="left" class="InputCell"><div align="center" class="byline1">. : : Post Reply / <a href="post1.cfm">Discussion</a> : : . </div></TD>
</TR>
<TR>
<TD colspan="2" ALIGN="left" class="byline1"></TD>
</TR>
<TR>
<TD WIDTH="89" ALIGN="left" class="byline2">
Topic:
<BR></TD><TD WIDTH="457" ALIGN="left"><INPUT TYPE="hidden" NAME="PostAuthor" VALUE="<CFOUTPUT>#session.User.UserName#</CFOUTPUT>">
<INPUT TYPE="hidden" NAME="TopPost" VALUE="<CFOUTPUT>#postid#</CFOUTPUT>">
</TD></TR>
<TR>
<TD COLSPAN="2" ALIGN="left" class="byline2">
<cfinput name="PostHeader" type="text" class="byline2" size="93" required="yes" message="Topic cannot be Empty.." maxlength="50">
<input type="hidden" name="PostHeader_required" />
</TD>
</TR>
<TR><TD COLSPAN="2" ALIGN="left" class="byline2">
Message:<br />
<BR>
<cfTEXTAREA NAME="textarea" COLS="70" ROWS="15" required="yes" message="Description is Requird for the Topic & more than 100 chars">
</cfTEXTAREA>
</TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="left" class="byline2">Image Verification: </TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="left" class="byline2">
<cfoutput>
<cfinclude template="../captcha.cfm">
<img src="#easyCaptcha.IMAGE#" border="0" height="100" width="100"/></cfoutput></TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="left" class="byline2"><input name="secret" type="text" id="secret" /></TD>
</TR>
<TR>
<TD COLSPAN="2" ALIGN="left" class="byline2"><input name="submit" type="submit" class="byline3" value="Submit Message" /></TD>
</TR>
</CFFORM>
</TABLE>
</cfif>
<br />
<table align="center" width="100%">
<tr>
<td><div align="center"><a href="index1.cfm">Back to Home</a>
</div></td>
</tr>
</table>
</body>

next ouputting the output as:

<CFOUTPUT QUERY="qry_ReplyPosts" startrow="#URL.startrow#" maxrows="#rowsPerPage#">
</TR>

<TR>
<TD COLSPAN="2" ALIGN=left><table width="100%" border="0" align="center">
<tr>
<td class="filledup1"><table width="100%" border="0">
<tr>
<td width="3%" class="filledup1">
<img src="_images/icoTopic.gif" alt="Reply" width="17" height="13"></td>
<td class="filledup1">#PostHeader#</td>
</tr>
</table></td>
</tr>
<tr>
<td class="HeadImage">
<div>
#PostMessage#
</div>
</td>
</tr>
<tr>
<td class="byline3">#PostAuthor# - #DateFormat(PostDate,"MM/DD/YY")# - #TimeFormat(PostDate,"HH:MM")# </td>
</tr>
</table> </TD>
</TR>
</CFOUTPUT>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 26, 2007 Mar 26, 2007
You still haven't provided enough information. On your form, the textarea is named "textarea", yet on your output page you're outputting a CF variable called "PostMessage". Where is "PostMessage" getting set?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2007 Mar 26, 2007
<cfTEXTAREA NAME="textarea" COLS="70" ROWS="15" required="yes" message="Description is Requird for the Topic & more than 100 chars">
</cfTEXTAREA>

ok i changed to the value as:

<cfTEXTAREA NAME="PostMessage" COLS="70" ROWS="15" required="yes" message="Description is Requird for the Topic & more than 100 chars">
</cfTEXTAREA>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 26, 2007 Mar 26, 2007
The OPtion is still not working, Plz help me out this, sort
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 26, 2007 Mar 26, 2007
You need to help us help you. What's it doing now? You've changed some code...

Is it still showing the HTML formatting? If so, do a View Source on the page. My guess is all the < and > are &lt; and &gt;, which tells me that somewhere you're doing something to PostMessage before you output it. You need to post that code.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 26, 2007 Mar 26, 2007
Hi, are the #PostMessage# and #PostHeader# fields from qry_ReplyPosts??

When referencing query fields, make sure you prefix them with the query name as this makes it much easier to understand the code, ie. #qry_ReplyPosts.PostMessage# and #qry_ReplyPosts.PostHeader#.

If they are from qry_ReplyPosts then you will need to check what is being put into PostMessage as the problem isn't in the output but rather the content that is being saved.

As Kapitaine said, this probably isn't a coldfusion issue, but maybe more of a TinyMCE one? It might help to find a TinyMCE forum and post a question there?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 26, 2007 Mar 26, 2007
The problem is probably an easy one to solve.

In TinyMCE, if you just go ahead and type in xhtml code into the WYSIWYG text area, TinyMCE will automatically escape the characters you have typed in.

If you want to check if these have been escaped or not, on TinyMCE there is a "html" button. Click that and it shall show the raw source code of that WYSIWYG - check in there to see if the angle brackets ( e.g. < and > ) are actually coming out as escaped versions or not ( eg &gt; and NOT > as desired )

As the output shows the tags directly on the page and is not processing them as html, it leads me to believe that this is the case.

The reason TinyMCE escapes characters is because it is meant for people without html knowledge and will thus prevent as many problems with this as possible.

Not sure why this is a Coldfusion question though as it relates to it in no way whatsoever.

Another tip is to look in the database itself and see how it looks stored in there.

Cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 26, 2007 Mar 26, 2007
yes, i tend to agree with you: he must have typed actual html code in
the textarea, and thus tinymce has saved it as it has been typed,
escaping all html tags...

i have been using tinymce for about 3 years now, and never had this sort
of problem... but then i never typed html code into it, either :)

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2007 Mar 27, 2007
As the output shows the tags directly on the page and is not processing them as html, it leads me to believe that this is the case.

ok now when i enter the text as

Hello how are you, in the bigger size say h1 usingthe tinymce option.

it shows as

<h1> hello how are you</h1>

as you talked about the datbase, it stores the value as below in database field.

<h1> hello how are you</h1>

I want to show like this:

http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=20556#p20556

but the problem is it is not showing as adove.

it rather shows the html tags

as also i am outputting the PostMesage value in any textarea or something, using no such function like trim etc,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 27, 2007 Mar 27, 2007
quote:

Originally posted by: gavy81
as also i am outputting the PostMesage value in any textarea or something, using no such function like trim etc,


Not sure I understand that last sentence, are you saying you ARE displaying the output in a textarea or not? If its in a textarea then that's your problem as the textarea tag doesn't interpret html.

If it isn't in a text area, (ie. a div) then it certainly should display correctly provided the data is stored correctly.

If you do a cfdump of the query (qry_ReplyPosts?) what does the stored text look like?

<cfdump var="#qry_ReplyPosts#">


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2007 Apr 07, 2007
it is storing in the database as

&lt;h1&gt;I think sql server 2005 is stable than others.&lt;/h1&gt;&lt;p style="background-color: #ff6600"&gt;&lt;img src="../tinyMCE/plugins/emotions/images/smiley-undecided.gif" border="0" alt="Undecided" title="Undecided" /&gt; &lt;/p&gt;

it is escaping the characters of <> as i enter in tinymce editor, i use any other the same problem is there

the data is stored in the database as above..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 07, 2007 Apr 07, 2007
i really hope you are not trying to enter html code directly into
tinymce... your post is not very clear about what exactly you are
entering, where and how...
what tinymce converts to what depends a lot on the initialization
settings you have - it will be a good idea to post those, too

--

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 07, 2007 Apr 07, 2007
Ok this is what I have Posted on My websites Textarea Wysiwyg or say TinymCE Editor:

Hi, How are ou

This is great website

okay now this adobe website uses the , tags for processing but in my
editor i click the bold and the text is entered like the format of bold.

okay now i think it is pretty much clear to you guys.

now this info is stored in the database as:

&lt;PRE&gt;&lt;FONT color=#cc0000&gt;A GUID is a 128 bit number that, in&lt;/FONT&gt; theory, will never be duplicated &lt;EM&gt;by anyone, world-wide, ever.  The GUID&lt;/EM&gt; is created with arbitrary information such as the current millisecond, the network card's MAC address and random numbers.  It is said that a GUID has enough values

and it apperas in the website like this:

<PRE><FONT color=#cc0000>A GUID is a 128 bit number that, in</FONT> theory, will never be duplicated <EM>by anyone, world-wide, ever. The GUID</EM> is created with arbitrary information such as the current millisecond, the network card's MAC address and random numbers. It is said that a GUID has enough values

i think the problem is clear now, i am using access database and the it is of type Memo

plz help me now thanks..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 09, 2007 Apr 09, 2007
ok, If you're sunning CF7 then it sounds like the scriptprotect setting is enabled in the cfapplication tag or in CF admin. Have a look on this Livedocs page for information on the scriptprotect attribute.

Hope this helps, cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 12, 2007 Apr 12, 2007
Well, the Scriptprtect has not been selected in the application.cfm , i do not know what is hapening nd what is creating the problem, plz help me outta this, this is very wiered Problem for all who uses the Tinymce new version feature.

Grrr with this tinymce
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 15, 2007 Apr 15, 2007
Did you, or can you, look in CF Admin? Did you read the livedocs link I gave you?

The scriptprotect attribute can be turned on by default in CF Admin which means any script code detected in database fields, such as your html tags, are escaped before being saved to the database. This is a security feature which some Admins may turn on by default which is why you need to check CF Admin to make sure it hasn't been turned on there. Checking Application.cfm will only give you half the picture.

I suggest you look at the livedocs link from my previous post, here is some of what it has to say:
'Note: The ColdFusion MX Administrator Settings page Enable Global Script Protection option determines the default script protection setting. You can use the scriptProtect attribute to override the Administrator setting. You can also use the Application.cfc initialization code to set the protection value.'

Good luck.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources