Problem with JS API

  •  11-14-2008, 3:29 AM

    Problem with JS API

    Hi,
     
    I'm having some problems with the JavaScript API in a C# ASP.NET project when viewed in FireFox 3.0.3
     
    I am loading the editor (CE) when the page is generated. When the user clicks on a button (input type - no postback), the editor is brought up at the location of the button, and the text is set to the value of a hidden field before finally setting Focus to the editor.
     
    My problem is that the focus doesn't work.
     
    The script I am using is based on AJAX:
    function showEditor(target)
    {
       var elementRef = $get(target);
       var elementLoc = Sys.UI.DomElement.getLocation(elementRef);
     
       var editorBox = document.getElementById("editorBox");
       editorBox.style.position = "absolute";
       editorBox.style.visibility = "visible";
       Sys.UI.DomElement.setLocation(editorBox, elementLoc.x, elementLoc.y);
                                                                
       var editor = document.getElementById("CE_Editor_ID")
       var editDoc = editor.GetDocument();
                                                                
       editor.FocusDocument();
       editor.SetHTML(document.getElementById("temp").value);
    }

    target = ID of the target pressed
    editorBox = The Table in which the editor is placed
    editor = The editor that I want to use
    temp = The hidden field containing the initial text, if any, for the editor.
     
    If anyone could tell me what I am doing wrong, then place let me know, as this is my 2nd day dealing with a workaround for this problem.
     
    Thanks in advance,
    Mireigi
     
    Edit: Found out that there is only a problem when viewing in Firefox.
View Complete Thread