Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4615618
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:51:57+00:00 2026-05-22T01:51:57+00:00

I am developing a WYSIWYG editor using the iframe technique. I need to know

  • 0

I am developing a WYSIWYG editor using the iframe technique. I need to know an idea to set a JavaScript method to overide keyboard event replacing charCode to another CharCode of a different language. For example if I am pressing “a” it will return the Arabic character set in Arabic language keyboard.

UPDATE – 14th May 2011
I have managed to implement a solution as suggested by @Tim only on chrome browser. I have noticed incompatibility of switching the designMode=”on” when it is created inside the DOM using javascript. Following is the code and you can also see the test page here – jsfiddle

JAVASCRIPT – JQUERY

$(document).ready(function(){
var textarea = $("#textarea"); 
var frame = $("<iframe class='thaana-editor-html' id='editable' />");
$(frame).width('500px'); 
$(frame).height('250px'); $(textarea).parent().prepend(frame);
var iframe = document.getElementById("editable"); 
var iframeObject = $(iframe).contents().get(0); 
iframeObject.designMode = "on";

});

HTML

<div id="content">
<textarea class="thaanaEditor" id="textarea" ></textarea>
</div>

I have tested on

  • Chrome v11 – works fine
  • IE8 – works fine
  • IE9 – not tested yet
  • Firefox -3.6 & 4 – NOT working – iframe is not editable as in designmode
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:51:58+00:00Added an answer on May 22, 2026 at 1:51 am

    I’ve answered a similar question before: Need to set cursor position to the end of a contentEditable div, issue with selection and range objects (see also Changing the keypress). The same technique applies to an editable iframe: you’ll need to add the keypress event handler to the iframe’s document. For example:

    function handleKeypress(evt) {
        // See linked answer for implementation
    }
    
    var iframe = document.getElementById("your_iframe_id");
    var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
    
    if (iframeDoc.addEventListener) {
        iframeDoc.addEventListener("keypress", handleKeypress, false);
    } else if (iframeDoc.attachEvent) {
        iframeDoc.attachEvent("onkeypress", handleKeypress);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a site locally using xampp. The path the images are using is
Developing a module for drupal and I need to pass/modify variables within functions. I
im developing windows application using c#. i want to close the application and show
Developing a bridge to use a cms with MongoDB I use a storage key,
Developing a WP7 app, and I'm trying to post something to the user's feed.
iam developing iPhone application that allow user to define stations near to him, so
After developing mini project with WCF duplex (Chat Service | Sms Service), I got
Background Developing a simple web application (Eclipse + JBoss + Apache Tomcat) to generate
I developing a plugin which reads from a .properties file for the database connection,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.