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?
- How do I dynamically change the content in the editor with JavaScript?
- .SetHTML doesn't work! Why not?
- How do I call a javascript function on the page containing the editor from a plugin?
- How do I capture an onkey event within FCKeditor?
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)