Hi -
I'm having a problem with formatting between RTE and just regular editing, within an IFRAME. Currently, in a doc called rteparent.htm, what I'm doing is generating the IFRAME with a blank document inside, which is for the straight text editing. Upon clicking the 'toggle RTE' link, I change iframe.location.href to the page containing the rte code (rte/rtechild.htm). In order to transmit the data between the child and the parent, i've set up a form on the parent that has a hidden field, then from inside rtechild I reference opener.formname.formfield.value. Unfortunately, when i do this i also lose the abilty to wrap any text that the user types in. While this isn't too big a deal, it leads to some issues when they try to scroll horizontally. Is there anything I can do about this?
Here's the JS code i'm using to toggle the rte on and off:
TIA leo
------------
Leo Mendoza
lmendoza@garbersoft.net
I'm having a problem with formatting between RTE and just regular editing, within an IFRAME. Currently, in a doc called rteparent.htm, what I'm doing is generating the IFRAME with a blank document inside, which is for the straight text editing. Upon clicking the 'toggle RTE' link, I change iframe.location.href to the page containing the rte code (rte/rtechild.htm). In order to transmit the data between the child and the parent, i've set up a form on the parent that has a hidden field, then from inside rtechild I reference opener.formname.formfield.value. Unfortunately, when i do this i also lose the abilty to wrap any text that the user types in. While this isn't too big a deal, it leads to some issues when they try to scroll horizontally. Is there anything I can do about this?
Here's the JS code i'm using to toggle the rte on and off:
Code:
rteparent.htm
/*function: toggleRTE
*@params: elt - IFRAME name
*@returns: none
* - switches on and off the RTE editing. Retains all content when switching to and from
*/
function toggleRTE(elt) {
var contents; //for the HTML content, making sure to strip out a xmp mark.
var target = frame[elt]; //make life easier
if (target.location.href.match(/dpg\.asp/gi)) {
contents = frame(target.name).document.body.innerHTML;
// contents = contents.replace(/<\s*\/xmp>\s*<\s*xmp\s*>/gi,"<br><br>"); //format it a little bit to maintain consistency
// contents = contents.replace(/\n/gi,"<br>");
// contents = contents.replace(/<\s*xmp\s*>|<\s*\/\s*xmp\s*>/gi," ");
form.tempHolder.value = contents;
eval("form.h" + target.name + ".value = " + target.name + ".document.body.innerText;"); //get stuff already there
target.location.replace("rte/rtechild.htm");
frame(target.name).document.designMode = "Off"; //since the IFRAME handles everything else
} else {
target.location.replace("");
contents = frame(target.name).document.frames[0].document.body.innerHTML;
// contents = contents.replace(/<br>/gi,"\n");
// contents = contents.replace(/<\/?p>/gi,"\n\n");
form.tempHolder.value = contents;
frame(target.name).document.open();
// frame(target.name).document.write("<xmp>" + form.tempHolder.value + "</xmp>");
frame(target.name).document.write(form.tempHolder.value);
frame(target.name).document.close();
frame(target.name).document.designMode = "On";
} //end if
} //end toggleRTE
TIA leo
------------
Leo Mendoza
lmendoza@garbersoft.net