tags:

views:

44

answers:

1

I'm loading content to a textarea, which is then initialized as an instance of tiny mce. It works perfect until the textarea has only paragraph. When I try to load a paragraph with an image inside it, it works strange. All the content inside the original paragraph is moved to a new paragraph and the original is added empty. Why this is happening. Thanks in advance.

I'm trying to load following :-

<p id="paragraph-06C073B3-6BA7-AE52-7BFE-9CA282E448DC" 
class="textElementClass"><div aria-disabled="true" style="position: relative; 
z-index: auto;" class="draggableItem imageElement NestedImg ui-draggable-disabled
ui-state-disabled" id="Element-4C4AC020-0B32-99E9-356E-CCD6470E8294">
<img style="position: relative;" src="images/file-managements.png" class="ImageEdit 
ui-draggable ui-draggable-disabled" 
id="image-4C4AC020-0B32-99E9-356E-CCD6470E8294"></div>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum
has been the industry's standard dummy text ever since the 1500s, when an unknown 
printer took a galley of type and scrambled it to make a type specimen book. It has 
survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged. It was popularised in the 1960s with the release of 
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p><div 
style="" class="dropAfter ui-droppable"></div>

After loading it gets changed to :

<p id="paragraph-06C073B3-6BA7-AE52-7BFE-9CA282E448DC" 
class="textElementClass">&nbsp;</p>
<div id="Element-4C4AC020-0B32-99E9-356E-CCD6470E8294" class="draggableItem 
imageElement NestedImg ui-draggable-disabled ui-state-disabled" style="position:
relative; z-index: auto;"><img id="image-4C4AC020-0B32-99E9-356E-CCD6470E8294"
class="ImageEdit ui-draggable ui-draggable-disabled" style="position: relative;"
src="images/file-managements.png" alt="" /></div>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
   Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an 
   unknown printer took a galley of type and scrambled it to make a type specimen book. It 
   has survived not only five centuries, but also the leap into electronic typesetting, 
  remaining essentially unchanged. It was popularised in the 1960s with the release of 
  Letraset sheets containing Lorem Ipsum passages, and more recently with desktop 
  publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  <p>&nbsp;</p>
A: 

It might be because the p-tag is used as default wrapping element by tinymce leading to this wierd behavior.

EDIT: *"/div>"* is not a valid html tag. Try to verify the html you want to insert.

Thariama
@Thariama, I have edited the question. Thanks
KutePHP
It was a mistake, generated while I tried to format the code. I have checked and the whole HTML is valid. Kindly help. I'm still stuck into this.
KutePHP
so did i with my answer
Thariama