I'm using the HtmlEditor from the Ajax Toolkit on a webform.
If a user clicks Cancel, all the fields on the form are reset to the previous value. Apart from the content in the HtmlEditor.
How can I achieve this?
Comments: HtmlEditorExtender renders the markup in special div elements: one div for the source view and another for the HTML view. To access it, you can define a behavior name and get an id of a div by adding '_ExtenderContentEditable' or '_ExtenderSourceView'. For example, if you define BehaviorID as 'htmlEditor1Behavior', you can clear the div content as follows: ``` document.getElementByID("htmlEditor1Behavior_ExtenderContentEditable").innerHTML = ""; document.getElementByID("htmlEditor1Behavior_ExtenderSourceView").innerHTML = ""; ```
If a user clicks Cancel, all the fields on the form are reset to the previous value. Apart from the content in the HtmlEditor.
How can I achieve this?
Comments: HtmlEditorExtender renders the markup in special div elements: one div for the source view and another for the HTML view. To access it, you can define a behavior name and get an id of a div by adding '_ExtenderContentEditable' or '_ExtenderSourceView'. For example, if you define BehaviorID as 'htmlEditor1Behavior', you can clear the div content as follows: ``` document.getElementByID("htmlEditor1Behavior_ExtenderContentEditable").innerHTML = ""; document.getElementByID("htmlEditor1Behavior_ExtenderSourceView").innerHTML = ""; ```