Results 1 to 3 of 3

Thread: Design Mode Focus

  1. #1
    Join Date
    Apr 2007
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Design Mode Focus

    Hi,

    Im working on a simple text editor on a web page, and to do this im using a page that has the property "DesignMode" set to "on". This page is then put inside an iframe as the "editable region".

    I have some controls that handle for example toggle bold, italic, etc using the document.execCommand on the iframes page.

    However, when I click the commands (that are outside the iframes page) the focus is lost from the editable region.

    Is there anyway to put to focus back onto the editable page that is in design mode inside the iframe?

  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    Not that I can think off.

    You are effectively focusing on a different page.

    you may be able to access the selected text on the ifram through the DOM.

    Maybe a mod knows.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    iframe.focus() ought to work.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •