I am getting an error in an auto generated script when usng the HTMLEditor Extender in IE in an application that is currently in development ... it doesn't seem to happen in Firefox or Chrome. Here is the generated code:
_editableDiv_submit: function () { var char = 3; var sel = null; setTimeout(function () { if (this._editableDiv != null) this._editableDiv.focus(); }, 0); if (Sys.Browser.agent != Sys.Browser.Firefox) { if (document.selection) { sel = document.selection.createRange(); sel.moveStart('character', char); sel.select(); } else { sel = window.getSelection(); sel.collapse(this._editableDiv.firstChild, char); } } this._textbox._element.value = this._encodeHtml(); },
When it reaches the line that is in italics in the code above, even thought this._editablediv contains the ID of the HTMLeditor extender, the firstchild of this._editablediv is empty and is set to Nothing producing an error. Does anyone have an ideas what may be causing this ... very frustrating since I can't correct or change auto generated code which I assume is coming from the AjaxToolKit DLL. Below is the page code with the editor extender:
<asp:updatePanel ID="PanelEditHTML" runat="server"><ContentTemplate><div style="border: 1px solid #000000; background-color: #FFFFFF; color: #000000; text-align: left;" class="rounded"><asp:TextBox ID="TextBoxEditHTML" runat="server" TextMode="MultiLine" Rows="7" Columns="70" BorderStyle="None" BorderWidth="0"></asp:TextBox><ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextBoxEditHTML" EnableSanitization="False"><Toolbar><ajaxToolkit:Bold /><ajaxToolkit:Italic /><ajaxToolkit:Underline /><ajaxToolkit:StrikeThrough /><ajaxToolkit:Subscript /><ajaxToolkit:Superscript /><ajaxToolkit:HorizontalSeparator /><ajaxToolkit:JustifyLeft /><ajaxToolkit:JustifyCenter /><ajaxToolkit:JustifyRight /><ajaxToolkit:JustifyFull /><ajaxToolkit:Indent /><ajaxToolkit:InsertOrderedList /><ajaxToolkit:InsertUnorderedList /><ajaxToolkit:HorizontalSeparator /><ajaxToolkit:SelectAll /><ajaxToolkit:UnSelect /><ajaxToolkit:Copy /><ajaxToolkit:Cut /><ajaxToolkit:Delete /><ajaxToolkit:Paste /><ajaxToolkit:RemoveFormat /><ajaxToolkit:HorizontalSeparator /><ajaxToolkit:Undo /><ajaxToolkit:Redo /><ajaxToolkit:HorizontalSeparator /><ajaxToolkit:BackgroundColorSelector /><ajaxToolkit:ForeColorSelector /><ajaxToolkit:FontNameSelector /><ajaxToolkit:FontSizeSelector /></Toolbar></ajaxToolkit:HtmlEditorExtender></div></ContentTemplate></asp:updatePanel>