I have multiple HTMLAreas appearing on a tabbed page (Which is in javascript). I am using the HTMLArea.replaceall method to replace all textareas with RTE's. The editors work fine when the page loads in IE. My problem is when I change tab pages in mozilla (i.e. previous page is set to display='none' and new page set to display='block') and return to the origional page, I can no longer type in the iframe.
What I discovered was that the designmode in Mozilla is set back to 'off' when the page changes back. I have created the following function which is fired when a page is changed so as to set the designmode to 'on'.
function setdesignmode() {
var textareas = document.getElementsByTagName('textarea');
if(HTMLArea.is_gecko) {
for(var i in textareas) {
if(textareas.id) {
editor = textareas.id;
document.getElementById(editor).contentDocument.designMode = "off";
document.getElementById(editor).contentDocument.designMode = "on";
document.editor.focus();
}
}
};
};
My function above targets textareas, but how can I target the iframe/htmlarea which is created by HTMLArea?
Note: the HTMLArea is given the same name as the textarea
Can anybody help!!! Thanks
What I discovered was that the designmode in Mozilla is set back to 'off' when the page changes back. I have created the following function which is fired when a page is changed so as to set the designmode to 'on'.
function setdesignmode() {
var textareas = document.getElementsByTagName('textarea');
if(HTMLArea.is_gecko) {
for(var i in textareas) {
if(textareas.id) {
editor = textareas.id;
document.getElementById(editor).contentDocument.designMode = "off";
document.getElementById(editor).contentDocument.designMode = "on";
document.editor.focus();
}
}
};
};
My function above targets textareas, but how can I target the iframe/htmlarea which is created by HTMLArea?
Note: the HTMLArea is given the same name as the textarea
Can anybody help!!! Thanks