editable window (iframe) does not show?

  •  07-04-2009, 7:26 AM

    editable window (iframe) does not show?

    I have installed the editor in my php files but the window where you edit the text does not show. It seems to have to do with some code I use, but I don't understand why. Maybe somebody can help me out?
    Here we go:

    Javascript code, to hide and show a div-layer:
    1. function divShow(layer_ref) {  
    2.     if (document.all) { //IS IE 4 or 5 (or 6 beta)  
    3.         eval( "document.all." + layer_ref + ".style.display = 'block'");  
    4.     }  
    5.     if (document.layers) { //IS NETSCAPE 4 or below  
    6.         document.layers[layer_ref].display = 'block';  
    7.     }  
    8.     if (document.getElementById &&!document.all) {  
    9.         hza = document.getElementById(layer_ref);  
    10.         hza.style.display = 'block';  
    11.     }  
    12. }  
    13.   
    14. function divHide(layer_ref) {  
    15.     if (document.all) { //IS IE 4 or 5 (or 6 beta)  
    16.         eval( "document.all." + layer_ref + ".style.display = 'none'");  
    17.     }  
    18.     if (document.layers) { //IS NETSCAPE 4 or below  
    19.         document.layers[layer_ref].display = 'none';  
    20.     }  
    21.     if (document.getElementById &&!document.all) {  
    22.         hza = document.getElementById(layer_ref);  
    23.         hza.style.display = 'none';  
    24.     }  


    CSS Code for the div-layer
    1. .window_add {  
    2.   display: none;  
    3.   margin0px 0px 20px 0px;  
    4.   padding10px;  
    5.   border1px dashed red;  

    PHP code for the editor:
    1. # $tbl is defined earlier in the script  
    2.   
    3. echo "<div class=\"window_add\" id=\"articles_".$tbl."_new_add\">\n";  
    4.   
    5. $editor=new CuteEditor();  
    6. $editor->ID="Editor1";  
    7. $editor->Text="Type here loads of text...";  
    8. $editor->EditorBodyStyle="font:normal 12px arial;";  
    9. $editor->EditorWysiwygModeCss="php.css";  
    10. $editor->FilesPath="CuteEditor_Files";  
    11. $editor->Draw();  
    12. $editor=null;  
    13.   
    14. echo "</div>\n"
    When executing this page, initially nothings shows because the "display" for the DIV is set to "none". When pressing the show button, the editor shows, BUT the editable field (the iframe) does not show!
     
    When changing the CSS and typing "display: block", everything shows fine. Also when you show and hide the DIV.

    So, the problem seems to be that when the "display" is initially "none", something goes wrong with showing the iframe. But why???

    I hope somebody can help me out here!
View Complete Thread