Results 1 to 2 of 2

Thread: PROBLEM wysiwyg editor

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    6

    Unhappy PROBLEM wysiwyg editor

    Hi, I try write function for put class definiton in <P> tag in wysiwyg editor. I have problem because I use execCommand method which hasn't command for insert class attribute.

    How I can put unspecific class tag with execCommand method in IFRAME ? If somebody now any solution for it i'll be grateful.

    For example:

    When I selected some text from IFRAME I wish receive this
    <P class=xyz>selected text</P> ON SAME PLACE WHERE SELECTED TEXT WAS.

    Problem with this function is because that put selected text to end of page. How I can put text on same place ?

    function InsertClass (cmd,opt) {

    var strStart,strEnd,A;

    //copy selected text to clipboard
    idContent.document.execCommand('copy',"",opt);

    strStart="<P class=xyz>";
    strEnd=</P>;

    // convert TextMode in HTMLMode
    A=idContent.document.body.innerHTML;
    idContent.document.body.innerText=A;
    idContent.focus();


    idContent.document.execCommand('paste',"",strStart);
    idContent.document.execCommand('paste',"",opt);
    idContent.document.execCommand('paste',"",strEnd);

    // convert TextMode in HTMLMode
    A=idContent.document.body.innerText
    idContent.document.body.innerHTML=A;
    idContent.focus();

    }

    Sorry about my little english.

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    6

    HELLLPPP

    Eny suggestion?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width