Jump to content
Killersites Forums

WYSIWYG Editor Issue


Recommended Posts

HI Guys,


Just wondering if anyone got this issue that I have been having, sometimes when i paste content directly into tinymce and try to input more content after the part pasted prior it does not update the database. Even if i safely paste the content in by pressing the paste button, I still get this issue.


It doesn't happen all the time, just every so often... Checked the entire cms and cannot spot any errors.


the code for Tiny MCE within the v_edit file is the following

<!-- jQuery Block Start-->
<!-- jQuery is used to catch the forms submit process -->
<script type="text/javascript">

           //Disable the default browser refresh

           //Ajax to process the form
           var id = "<?php echo $this->getData('block_id')?>";
           var type = $('#type').val();

           //This is for TinyMCE Ajax
           <?php if($this->getData('block_type') == 'wysiwyg') {?>
           <?php }?>

           var content = $('#field').val();

           //Passing the values onto Ajax
           var dataString = 'id=' + id + '&field=' + content + '&type=' +type;

           //Call ajax
               type: "POST",
               url: "<?php echo SITE_PATH; ?>app/cms/edit.php",
               data: dataString,
               cache: false,
               success: function(html) {

       //jQuery to close the box
       $('#fs_cancel').live('click', function(e){
           //This is addressing the issue with open close then reopen issue
                   tinyMCE.execCommand('mceFocus', false, 'field');
                   tinyMCE.execCommand('mceRemoveControl', false, 'field');

<?php if($this->getData('block_type') == 'wysiwyg')
{ ?>

       <script type="text/javascript">
		// General options
		mode : "none",

		skin : "thebigreason",

		theme : "advanced",
		plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,\n\

		// Theme options
		theme_advanced_buttons1 : "fontsizeselect,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,\n\
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "sub,sup,|,charmap,iespell,advhr,",
		theme_advanced_buttons4 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "center",
               //once again below is to load the editor addressing open close issue
               setTimeout(function() {tinyMCE.execCommand('mceAddControl', false, 'field');}, 0);

<? }?>

<!-- jQuery Block End-->

<div id="fs_wrapper">
      <form action="" method="post" id="edit">

             <div class="row">
                <h1>Edit Content <?php // echo $this->getData('block_id'); ?></h1>
                <p>Click and edit below</p>

            <div class="row">
              <?php echo $this->getData('cms_field');?>
              <input type="hidden" id="type" value="<?php $this->getData('block_type');?>">
            <input type="submit" name="submit" class="green_button" value="Submit">
            <a href="#" id="fs_cancel">Cancel</a>


If anyone could help that would be great.


Kind Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...