There is a cleditor script.

And there is a popup block

$("#post").cleditor(); 
 <script type='text/javascript'> function show_message(state){ document.getElementById('window').style.display = state; document.getElementById('wrap').style.display = state; } </script> <div onclick='show_message("none")' id='wrap'></div> <div id='window'> <div class='message_close' onclick='show_message("none")'></div><br> <form action='post' method='post'> <textarea rows='4' id='post' name='text'></textarea><br> <input type='hidden' name='poluchatel' value='$myrow[login]'> <input type='hidden' name='id' value='$myrow[id]'> <input type='submit' name='submit' value='Отправить'> </form> </div> <center><div class='myButton' onclick='show_message("block")'>Написати листа</div></center> 
(does not work because the cleditor script is needed)

If I push out the textarea for a block, then everything works, and if it is in a pop-up block, it becomes inactive (just gray, but the script is activated).

  • "Write a sheet" - what does this mean? - Codd Wrench Nov.
  • @CoddWrench is Ukrainian in Russian means. Write a letter - BedOmar

1 answer 1

Maybe it is worth using jquery , since it is already in the project?

So it will turn out:

js:

 $(function() { $("#post").cleditor(); $("#button").click(function () { $('#window').toggle(); }); }); 

html

 <div id='window'> <form action='post' method='post'> <textarea rows='4' id='post' name='text'></textarea><br> <input type='hidden' name='poluchatel' value='$myrow[login]'> <input type='hidden' name='id' value='$myrow[id]'> <input type='submit' name='submit' value='Отправить'> </form> </div> <center> <button id="button" class='myButton'>Закрыть/Открыть</button> </center> 

Jsfiddle example