JavaScript"

This website contains links to software which is either no longer maintained or will be supported only until the end of 2019 (CKFinder 2). For the latest documentation about current CKSource projects, including software like CKEditor 4/CKEditor 5, CKFinder 3, Cloud Services, Letters, Accessibility Checker, please visit the new documentation website.

If you look for an information about very old versions of CKEditor, FCKeditor and CKFinder check also the CKEditor forum, which was closed in 2015. If not, please head to StackOverflow for support.

Line 8: Line 8:
  
 
=== <span id="tabindex">How do I apply a tabindex on the FCKeditor?</span> ===
 
=== <span id="tabindex">How do I apply a tabindex on the FCKeditor?</span> ===
 +
 +
By adding some Javascript:
 +
 +
On the field just before the FCKEditor: <input ... onKeyDown="focusIframeOnTab(this, "idOfYourFckEditorIframe", event);if(!document.all) return false;">
 +
 +
Use this function:
 +
<pre>
 +
function focusIframeOnTab(caller, tabTargetId, callEvent)
 +
{
 +
    // If keypress TAB and not SHIFT+TAB
 +
    if(callEvent.keyCode == 9 && !callEvent.shiftKey)
 +
        document.getElementById(tabTargetId).contentWindow.focus();
 +
}
 +
</pre>
 +
Remember that the id of the iframe should look like "identifier___Frame".
 +
 +
((Please feel free to write to fredrik@demomusic.dot.nu for suggestions on improving this function. Verified to work in Firefox 1.5 and IE 6 on WinXP)

Revision as of 17:34, 18 January 2008

Frequently Asked Questions : JavaScript

How do I apply a tabindex on the FCKeditor?

By adding some Javascript:

On the field just before the FCKEditor: <input ... onKeyDown="focusIframeOnTab(this, "idOfYourFckEditorIframe", event);if(!document.all) return false;">

Use this function:

function focusIframeOnTab(caller, tabTargetId, callEvent)
{
    // If keypress TAB and not SHIFT+TAB
    if(callEvent.keyCode == 9 && !callEvent.shiftKey)
        document.getElementById(tabTargetId).contentWindow.focus();
}

Remember that the id of the iframe should look like "identifier___Frame".

((Please feel free to write to fredrik@demomusic.dot.nu for suggestions on improving this function. Verified to work in Firefox 1.5 and IE 6 on WinXP)