I want to verify whether the user has modified contents in FCKEditor UI. So I am storing the values in hidden field. And I want to compare in javascript in client side.
But I am getting different content, so even if I am not changing, javascript is validation to false.
var oldText=window.document.frmTradeInstructions.Editorhidden.value;
var EditorWindow=htmlEditor___Frame.window.frames['eEditorArea'];
var newText= EditorWindow.frameElement.contentWindow.document.body.innerHTML;
if (oldText.length ==newText.length) always returns false when there are HTML Tags in the text.
Thanks for any help to fix this problem.
But I am getting different content, so even if I am not changing, javascript is validation to false.
var oldText=window.document.frmTradeInstructions.Editorhidden.value;
var EditorWindow=htmlEditor___Frame.window.frames['eEditorArea'];
var newText= EditorWindow.frameElement.contentWindow.document.body.innerHTML;
if (oldText.length ==newText.length) always returns false when there are HTML Tags in the text.
Thanks for any help to fix this problem.

RE: HTML is different in javascript
Then you could record the fact that the data has changed. Even if you get the length comparison working, that won't tell you if the user does something simple like fixing a typo.
RE: HTML is different in javascript
RE: HTML is different in javascript
So I am loading the contents in hidden field and to the editor. But again while verifying the javascript editor shows different content than the one assigned at the codebehind using Editor.value = "<BR>Testing 1234 <P> ABCD "
RE: HTML is different in javascript
RE: HTML is different in javascript
dropdown onchange="var oEditor = FCKeditorAPI.GetInstance('htmlEditor');
if (!oEditor.IsDirty())
__doPostBack('dropdownName','');
else
if (!confirm('Text changed. Do you want to Continue and loose all the changes?'))
resetIndexes('dropdownName');
else
__doPostBack('dropdownName','')"