views:

23

answers:

1

Hi, I am trying to create a java script function to keep track of the changes made in a web form while submitting the page. For normal .net textbox or textarea I can compare the value with default value.

var ele = document.forms[0].elements;

for ( i=0; i < ele.length; i++ ) 
{
   if ( ele[i].value != ele[i].defaultValue ) return true;

}

But the problem is, I have a dnn texteditor in my web page. And ele[i].value does not change if user change the text in the texteditor. It always returns false as it could not track the changes.

Is there any attributes of the dnn texteditor control that holds the changes data?

+1  A: 

I got my solution. We could catch FCKeditorAPI from DOM to get the value of DNN Rich editor

var ele = document.forms[0].elements;

for ( i=0; i < ele.length; i++ ) 
{
   if(ele[i].type =="hidden"
   {
      if(ele[i].id.toString().toLowerCase().indexOf("dnnrich") != -1 && ele[i].id.toString().toLowerCase().indexOf("config") == -1)
     {  

        for ( var name in FCKeditorAPI.__Instances)
        {
            var oEditor = FCKeditorAPI.__Instances[name] ;
            if(oEditor.IsDirty())  return true;            
        }
     }
   }


}
miti737