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.
<script>
$(function() {
$('#opener').click(function(){
$('#dialog').dialog('open');
$('#dialog textarea').ckeditor();
});
$(function(){
$('#dialog').dialog({
autoOpen:false,
modal: true,
width: 745,
position: ['center','center'],
open: function() {
/**
* Hide error box and clear message text
*/
$(this).find('.error').hide();
$(this).find(':input[name="body_header"]').val('');
},
buttons: {
'Ok': function() {
alert($(this).find('#body_header').val()); //zamiast alertu ma wysyłać dane z textarea do pliku xxx.php
},
'Cancel': function() {
$(this).dialog('close');
}
},
close:function(){
var editor = $('#dialog textarea').ckeditorGet();
editor.destroy();
}
});
});
});
</script>
Kod w html to:
<div align="left" style="display:block; position:absolute; z-index:10" > <a href="#dialog" id="opener">otworz
</a> <td width="79%" height="124" valign="top" align="left" OnMouseOver="this.style.backgroundColor=''; this.style.zIndex=100;" OnMouseOut="this.style.backgroundColor='transparent';">
<div id="dialog" style=" float: left; background-color:white; display:none; ">Napisz do mnie
<textarea class="ckeditor" cols="80" id="editor1" name="body_header" rows="10"><?php echo $body_header ?></textarea>