doctype and dtd

2 posts, 1 answers
  1. Jim Duncan
    Jim Duncan avatar
    3 posts
    Member since:
    May 2010

    Posted 03 Jun 2010 Link to this post


    Is there any way to change the doctype tag used inside the editor control?

    The doctype in our master page is this:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> 

    While in the (document inside the IFRAME embedded in the) editor control seems to be this:

    As a result of the two being different (namely the dtd reference), edit mode renders differently from display mode. For instance, paragraphs inside a table cell are left aligned when in edit mode but are centered in the table cell when the page is saved.

    Is there anything I can do to force the document in the embedded IFRAME to use the same doctype tag that we are using in the master page?

  2. Answer
    Stanimir avatar
    1654 posts

    Posted 09 Jun 2010 Link to this post

    Hello Jim,

    I can suggest you the following workaround of the problem:

    1. Set the OnClientLoad and OnClientSubmit properties of the editor correspondingly to OnClientLoad and OnClientSubmit. Review the following online help article You need to have both lines in the ConfigFile.xml or ListConfigFile.xml files:
    <property name="OnClientLoad">OnClientLoad</property>
    <property name="OnClientSubmit">OnClientSubmit</property>

    2. Make sure that the following javascript methods are defined in the page where the editor is loaded:
    function OnClientLoad(editor, args)
        if (!editor.get_fullPage())
            var content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">' +
                '<html xmlns=""><head><title></title></head><body>' + editor.get_html(true) + '</body></html>';
    function OnClientSubmit(editor, args)
        var html = editor.get_html(true);
        html = html.replace(/(\s|.)*<body>((\s|.)*)<\/body>(\s|.)*/gi, "$2");

    One good place to define them is the MOSSEditorTools.js file, which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/5.x.x.0__1f131a624888eeed/Resources/ folder.

    All the best,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top