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:
- function divShow(layer_ref) {
- if (document.all) {
- eval( "document.all." + layer_ref + ".style.display = 'block'");
- }
- if (document.layers) {
- document.layers[layer_ref].display = 'block';
- }
- if (document.getElementById &&!document.all) {
- hza = document.getElementById(layer_ref);
- hza.style.display = 'block';
- }
- }
-
- function divHide(layer_ref) {
- if (document.all) {
- eval( "document.all." + layer_ref + ".style.display = 'none'");
- }
- if (document.layers) {
- document.layers[layer_ref].display = 'none';
- }
- if (document.getElementById &&!document.all) {
- hza = document.getElementById(layer_ref);
- hza.style.display = 'none';
- }
- }
CSS Code for the div-layer
- .window_add {
- display: none;
- margin: 0px 0px 20px 0px;
- padding: 10px;
- border: 1px dashed red;
- }
PHP code for the editor:
- # $tbl is defined earlier in the script
-
- echo "<div class=\"window_add\" id=\"articles_".$tbl."_new_add\">\n";
-
- $editor=new CuteEditor();
- $editor->ID="Editor1";
- $editor->Text="Type here loads of text...";
- $editor->EditorBodyStyle="font:normal 12px arial;";
- $editor->EditorWysiwygModeCss="php.css";
- $editor->FilesPath="CuteEditor_Files";
- $editor->Draw();
- $editor=null;
-
- 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!