editable window (iframe) does not show?

Last post 07-20-2009, 12:26 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  07-04-2009, 7:26 AM 53728

    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!
  •  07-20-2009, 12:26 PM 54116 in reply to 53728

    Re: editable window (iframe) does not show?

    Please try this example:
     
     
    1. <?php include_once("CuteEditor_Files/include_CuteEditor.php") ; ?>   
    2. <html>       
    3.     <head>   
    4.         <script language="javascript">   
    5.         function hide()   
    6.         {   
    7.             document.getElementById("div1").style.display="none";   
    8.         }   
    9.         function show()   
    10.         {   
    11.             document.getElementById("div1").style.display="block";   
    12.         }   
    13.         </script>   
    14.     </head>   
    15.      <body>   
    16.     <form name="theForm" action="/Get_HtmlContent.php" method="post">   
    17.         <div id="div1">   
    18.           
    19.           <?php   
    20.                 $editor=new CuteEditor();   
    21.                 $editor->ID="Editor1";   
    22.                 $editor->Text="Hello World";   
    23.                 $editor->Draw();   
    24.                 $editor=null;   
    25.                    
    26.                 //use $_POST["Editor1"]to catch the data    
    27.             ?>   
    28.         </div>   
    29.             <hr>   
    30.             <a onclick="hide()" href="#">Hide</a> |    
    31.             <a onclick="show()" href="#">Show</a>   
    32.         </form>   
    33.     <script>   
    34.         hide();   
    35.     </script>   
    36.     </body>   
    37. </html>  

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML