Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 136337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:55:56+00:00 2026-05-11T06:55:56+00:00

I’m in a curious situation where I previously had no problem achieving what I’m

  • 0

I’m in a curious situation where I previously had no problem achieving what I’m looking for. The following code is a part of an HTML page which is to host a TinyMCE rich textbox:

... <textarea id='editing_field'>This text is supposed to appear in the rich textbox</textarea> ... 

At first this worked as intended, creating a rich textbox with the enclosed text in it. At some point, though, the TinyMCE code decided that the textarea HTML should be transformed to the following:

<textarea id='editing_field' style='display: none;'/> This text is supposed to appear in the rich textbox 

This renders the text below the textbox which is not exactly ideal. I don’t have a clue what caused this change of behavior, though I’m also using jQuery along with it if that could have any effect.

I can work around the problem by loading content into the textbox with javascript after the page has loaded, either by using ajax or by hiding the text in the HTML and just moving it. However, I would like to emit the text into the textbox directly from PHP if at all possible. Anyone knows what is going on here and how to fix it?

Update 2: I have succesfully reproduced the situattion which causes the change of behavior: At first I just had plain text in the textarea as in the first code snippet. However, after saving the content the text would look like this:

<p>This text is supposed to appear in the rich textbox</p> 

The presence of the p tag causes TinyMCE to trigger the transformation between an enclosing textarea to a textarea which is just a single tag (as illustrated above).

Update 1: added TinyMCE config file:

tinyMCE.init({         // General options         mode : 'exact',         elements : 'editing_field',         theme : 'advanced',         skin : 'o2k7',         skin_variant : 'black',         plugins : 'safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template',         save_onsavecallback : 'saveContent',          // Theme options         theme_advanced_buttons1 : 'save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull',          theme_advanced_buttons2 : 'search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,forecolor,backcolor',          theme_advanced_buttons3 : 'hr,removeformat,|,sub,sup,|,charmap,emotions,|,print,|,fullscreen,code',          theme_advanced_buttons4 : 'styleselect,formatselect,fontselect,fontsizeselect',         theme_advanced_toolbar_location : 'top',          theme_advanced_toolbar_align : 'left',          theme_advanced_statusbar_location : 'bottom',          theme_advanced_resizing : false,          // Drop lists for link/image/media/template dialogs         template_external_list_url : 'lists/template_list.js',         external_link_list_url : 'lists/link_list.js',         external_image_list_url : 'lists/image_list.js',         media_external_list_url : 'lists/media_list.js',          // Replace values for the template plugin         template_replace_values : {             username : 'Some User',             staffid : '991234'         },          width : '450',         height : '500'     }); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T06:55:57+00:00Added an answer on May 11, 2026 at 6:55 am

    It appears that I have solved the problem, unless there are any edge cases which ruins the solution. I use the following PHP code on page content before I save it to the database:

    $content = str_replace(chr(10), '', $content); $content = str_replace(chr(13), '', $content); $content = str_ireplace('<','&#x200B;<',$content); 

    What it does is it removes any newlines and then prepend a zero-width invisible character before any beginning tag. This text is then later inserted between the textarea tags before TinyMCE does its magic. I don’t know why but this does not trigger the problem and the appended characters are not shown in the final html or in the html view of TinyMCE, so the only problems I can see with this solution is the performance hit. A detail is that it appears only the start tags need to be prepended in this way, but I haven’t taken this into consideration here, for simplicity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer OK, I found my problem -- I thought I was… May 11, 2026 at 3:12 pm
  • added an answer I don't have a lot of personal experience with such… May 11, 2026 at 3:12 pm
  • added an answer First - I'm increasingly of the opinion that the xml… May 11, 2026 at 3:12 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.