Witam,

Mam wielki problem. Próbuję zrobić formularz w popup w jquery dialog z użyciem CKeditor.

Wszystko byłoby ok, gdybym miał tylko wywołać okno z dialogu z CKeditor, ale gdy zacząłem dodawać przyciski to pojawiły się problemy. Nie wyświetla się.

Jak naprawić ten kod, aby w wyświetlonym oknie dialog był funkcjonujący formularz. Po naciśnięciu 'OK' ma on wysyłać metodą $POST dane z TEXTAREA do pliku xxx.php z użyciem CKeditora.

  1. <script>
  2. $(function() {
  3. $('#opener').click(function(){
  4. $('#dialog').dialog('open');
  5. $('#dialog textarea').ckeditor();
  6. });
  7.  
  8. $(function(){
  9. $('#dialog').dialog({
  10. autoOpen:false,
  11. modal: true,
  12. width: 745,
  13. position: ['center','center'],
  14. open: function() {
  15. /**
  16.   * Hide error box and clear message text
  17.   */
  18. $(this).find('.error').hide();
  19. $(this).find(':input[name="body_header"]').val('');
  20. },
  21.  
  22. buttons: {
  23. 'Ok': function() {
  24. alert($(this).find('#body_header').val()); //zamiast alertu ma wysyłać dane z textarea do pliku xxx.php
  25. },
  26. 'Cancel': function() {
  27. $(this).dialog('close');
  28. }
  29. },
  30. close:function(){
  31. var editor = $('#dialog textarea').ckeditorGet();
  32. editor.destroy();
  33. }
  34.  
  35. });
  36. });
  37.  
  38. });
  39. </script>




Kod w html to:
  1. <div align="left" style="display:block; position:absolute; z-index:10" >
  2. <a href="#dialog" id="opener">otworz</a>
  3. <td width="79%" height="124" valign="top" align="left" OnMouseOver="this.style.backgroundColor=''; this.style.zIndex=100;" OnMouseOut="this.style.backgroundColor='transparent';">
  4. tresc</td>
  5. </div>
  6.  
  7. <div id="dialog" style=" float: left; background-color:white; display:none; ">Napisz do mnie
  8. <textarea class="ckeditor" cols="80" id="editor1" name="body_header" rows="10"><?php echo $body_header ?></textarea>
  9. </div>