Re: Creating editor with HTML and JS

  •  04-28-2008, 9:35 AM

    Re: Creating editor with HTML and JS

    After some more work, and understanding what is involved in displaying the editor, I found a workaround that doesn't need to use HTML only.
     
    Unfortunately, that created a new challenge.  I need to create the editor and then move it.
     
    <DIV ID="Original_Location">
      <DIV ID="Container">
    editor
      </DIV>
    </DIV>
     
    [.....  other page content ......]
     
    <DIV ID="Desired_Location">
    </DIV>
     
     
    I've tried 2 methods.
    Method 1:
    <SCRIPT type="text/javascript">
     document.getElementById("Desired_Location").innerHTML = document.getElementById("Original_Location").innerHTML;
     document.getElementById("Original_Location").innerHTML = "";
    </SCRIPT>
     
    This method moved the editor, but it was not usable. No cursor in the editor area.  the drop-downs worked, but the area where you type was not usable.
     
    The 2nd method was:
    <SCRIPT type="text/javascript">
      document.getElementById("Desired_Location").appendChild(document.getElementById("Container"));
      document.getElementById("Original_Location").innerHTML = "";
    </SCRIPT>
     
    This method works in IE7, but not in FF.
     

    Any thoughts or any other suggestions?
     
    Thanks,
    Peter

View Complete Thread