I have textarea with ckeditor plugins. before I have no problems using it, and the data can be saved correctly. but now I get the error "POST" ... path / url ... net :: ERR_CONNECTION_RESET. when I try to get into the process of working with good text. but when I enter a long text and turn on with some code, an error will appear. I did the following. p_post.php (form) -> p_post.js (validate) -> f_post.php (insert function).
Below is the p_post.js script
jQuery(function($) { var val_holder; $("form input[name='btnsubmit']").click(function() { // triggred click val_holder = 0; var txtjudul = jQuery.trim($("form input[name='txtjudul']").val()); // email field if(txtjudul == "") { $("span.txtjudul_val").html("Judul tidak boleh kosong."); val_holder = 1; } if(val_holder == 1) { return false; } val_holder = 0; $("span.validation").html(""); var datastring = $('#mainform'); datastring.on('submit', function(e) { e.preventDefault(); $.ajax({ url: 'http://example.com/fungsi/f_post.php', type: 'POST', dataType: 'html', data: datastring.serialize(), beforeSend: function() { }, success: function(e) { if(e == 1) { $("span.txtalert_val").html("Judul, Isi & Tags tidak boleh kosong!!"); } else { if(e == 3) { $("form input[type='text']").val(''); setTimeout(function(){ document.location.reload(); },1000); datastring.trigger('reset'); } } } }); }); }); });
and no problem with the insert function.
source share