Re: innerHTML of document

  •  09-13-2005, 4:23 PM

    Re: innerHTML of document

    No I don't have the same problem.
     
    My Code is here...
     
     <%@ Register TagPrefix="ce" Namespace="CuteEditor" Assembly="CuteEditor" %>  function On_Load() { //Get the cuteEditor Object and set the focus :) var CuteEd = new RichEditor("NoteEditor"); //Cell id and formated cell id. var cellId = document.all["hControlID"].value; var FcellId = document.all["hFControlID"].value; var cellValue; var cellFValue; //This is for formated text. switch(wParent.document.all[cellId].tagName) { case "TD": //Grid Cell cellValue = wParent.document.all[cellId].innerText; cellValue = ltrim(rtrim(cellValue)); //trim the sides please if(FcellId != null) { cellFValue = wParent.document.all[FcellId].innerHTML; cellFValue = ltrim(rtrim(cellFValue)); //trim the sides please } RequireParse = true; break; case "INPUT": //TextBox, Input control, etc. cellValue = wParent.document.all[cellId].value; cellValue = ltrim(rtrim(cellValue)); //trim the sides please RequireParse = false; break; default: cellValue = wParent.document.all[cellId].innerHTML; cellValue = ParseFromHtml(cellValue, 'all'); cellValue = ltrim(rtrim(cellValue)); //trim the sides please RequireParse = true; break; } //Remove and  ------------------------- re = new RegExp("&#160;","ig"); cellValue = cellValue.replace(re," "); cellFValue = cellFValue.replace(re," "); //----------------------------------------- document.all["hOldValue"].value = encodeURIComponent(cellValue); document.all["hOldValueFText"].value = encodeURIComponent(cellFValue); //We need to put the cellFValue var realId = "CE_" + "NoteEditor" + "_ID"; var richEd = document.getElementById(realId); var richDoc = null; if(richEd == null || richEd == "undefined") return; var richDoc = richEd.GetDocument(); richDoc.body.innerHTML = cellFValue; CuteEd.setFocus(); var newValue = document.all["hNewValue"].value; var newFValue = document.all["hNewValueFText"].value; if (newValue != "dummy-new-value" && newFValue != "dummy-new-value") { newValue = ltrim(rtrim(newValue)); newFValue = ltrim(rtrim(newFValue)); var returnData = new Array(document.all["hControlID"].value, document.all["hFControlID"].value, newValue, newFValue, document.all["hParam1"].value, document.all["hParam2"].value); //if exists, update PageDirty flag on the caller's page if (wParent.document.all["hPageDirty"] != undefined) wParent.document.all["hPageDirty"].value = "1"; // return data to the DialogContainer window.parent.ReturnDataFromDialog(returnData); } }
View Complete Thread