SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rich Text Selection

    Hi, I need to get the html of the selected object or html. It is in a rich text ediotor. Using idContent.document.selection.createRange().text; does not work, for it shows the text, I also need the html, not the text. What can I use to get this info? Thanks in advance!

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    Code:
     idContent.document.selection.createRange().htmlText
    http://www.webreference.com/js/column12/trmethods.html

    Mozilla implementation: http://www.pbwizard.com/Articles/Moz...rticle.htm#hd6
    ::: certified wild guess :::

  3. #3
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I tried that, but when you select a text box in the editor, it says undefined (it works fine for text). What I'm trying to accomplish is a feature where people can insert a form into the editor, then they can edit it, and I was going to use this to get the code for the text box (that they already made) and have the fields in the dialoge already filled in when they edit it.

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not entirely clear; does this help?
    ::: certified wild guess :::

  5. #5
    SitePoint Evangelist
    Join Date
    Sep 2003
    Location
    San Diego, CA
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya, it does, thanks!


Bookmarks

Posting Permissions

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