nickcoupland Posted June 2, 2010 Share Posted June 2, 2010 Hi Everyone, Not sure where i was meant to post this but i thought this area was the best for it. Just having one issue and is probably a simple fix. I am using the ckeditor in a form that push the content to a mysql database using php. I am also using a jquery function that autosaves using ajax every 20 secs. the autosave function put all the content into the DB except for the textarea that has the ckeditor applied to it. If i submit the the form by pressing the sumbit button everything works how it should, the problem only occurs when the javascript tries to do the saving for me. Heres the javascript code: <script type="text/javascript"> $(document).ready(function(){ autosave(); }); function autosave() { var t = setTimeout("autosave()", 20000); var title = $("#txt_title").val(); var text = $("#txt_content").val(); var author = $("#txt_author").val(); var issue = $("#txt_issue").val(); var category = $("#txt_category").val(); var date = $("#txt_date").val(); var image = $("#txt_image").val(); if (title.length > 0 || content.length > 0) { $.ajax( { type: "POST", url: "autosave.php", data: "id=" + <?php echo $article_id ?> + "&title=" + title + "&text=" + text + "&author=" + author + "&issue=" + issue + "&category=" + category + "&date=" + date + "&imageURL=" + image, cache: false, success: function(message) { $("#timestamp").empty().append(message); } }); } } </script> And here is the code on the textarea: <textarea class="ckeditor" name="text" id="txt_content" cols="50" rows="5"></textarea> I had this working with tinyMCE but i would prefer to use ckeditor as it works better with the system im making. Any help would be great. Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/203597-autosave-to-mysql-db-with-jquery-with-ckeditor/ Share on other sites More sharing options...
fenway Posted June 4, 2010 Share Posted June 4, 2010 What's the error? Quote Link to comment https://forums.phpfreaks.com/topic/203597-autosave-to-mysql-db-with-jquery-with-ckeditor/#findComment-1067909 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.