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 1042667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:32:39+00:00 2026-05-16T15:32:39+00:00

I’m using CKEditor to created the portion of my CMS for the user to

  • 0

I’m using CKEditor to created the portion of my CMS for the user to input content. My CMS is a bar/menu at the top with the sections of the site for the user to create, update, or delete an entry.

When the user selects an option I send the request for the form items to php using jquery AJAX $.post. The function returns the code and I use $(‘#loadCMS’).html(data) to create the form without reloading the page. This work great and debugging always shows the correct code returned.

However, CKEditor only loads the first time an item is selected. It may load again but it’s rare.

CKEditor is javascript that sits in the head and replaces specified textareas with the editor

<head>
...
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
...
</head

what is loaded dynamically to call the editor

<textarea name="editor1"></textarea>
    <script type="text/javascript">
        CKEDITOR.replace( "editor1",
        {
            toolbar :
            [
            ['Source'],
            ['Cut','Copy','Paste','PasteText','PasteFromWord','-', 'SpellChecker'],
        ['Undo','Redo','-','RemoveFormat'],
        ['Bold','Italic','Underline'],
        ['Subscript','Superscript'],
        ['NumberedList','BulletedList'],
        ['Link','Unlink'],
        ['Image','Flash','HorizontalRule','SpecialChar','Format'],
        ['Maximize', 'ShowBlocks','-','About']
            ],
            width : '1000',
            height : '300',
            filebrowserBrowseUrl : '/ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?Type=Flash'
        });
    </script>

jquery

$('#portfolioCreate').click(function()
    {
        var detailsList = new Array('title','medium','original');
        $.post('cms.php',{detailsList: detailsList,images:"imageOn",subimgNum:0,content1:"Comments"},
        function(data)
        {
            $('#loadCMS').html(data);
            $('#debug').val(data);
        });
    });

The forms are created dynamically every time. However, the textareas replaced by CKEditor does not always replace, it’s just blank not even the textarea box shows. The first time a selection is made it works. If the user chooses to create a new blog entry the text area is replaced, if they then choose to update bio no text area is ever replaced even if they go back to create a new blog entry.

—————–SOLUTION————————-

dynamic php

$key = md5(time().rand())
<textarea name="'.$key.'"></textarea>
<script type="text/javascript">
CKEDITOR.replace("'.$key'",
{
     .....
});
<input type="hidden" value="'.$key.'" name="content1Key" />
</script>

php to pull from form

$content1Key = $_POST['content1Key'];
$content1 = $_Post[$content1Key];
  • 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. Editorial Team
    Editorial Team
    2026-05-16T15:32:40+00:00Added an answer on May 16, 2026 at 3:32 pm

    CKEditor is very picky about dynamically creating forms because of the way they store references (in one global array keyed by textarea name I believe). Try to give each textbox a unique name to avoid it trying to return an existing reference that’s been destroyed/overwritten, and after loading each new form you need to call CKEDITOR.replace.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.