liontas Posted October 24, 2016 Share Posted October 24, 2016 I have install CKEDITOR to output text.Now i want to retrieve this text from SQL DB and insert into CKEDITOR for changes and updates.The value that I need to pass is $post_article.`The code below: <div class="form-group" id="article"> <label>ΚΕΙΜΕΝΟ</label> <textarea class="form-control" name="post_article" cols="30" rows="20"></textarea> <script>CKEDITOR.replace( 'post_article' ); CKEDITOR.instances.post_article.setData( '<p><?php echo $post_article;?></p>'); </script> </div> Unfortunately it doesn't work.Any suggestions or solutions?Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/302398-insert-text-from-sql-to-ckeditor/ Share on other sites More sharing options...
codefossa Posted October 31, 2016 Share Posted October 31, 2016 (edited) Without you giving us the value of $post_article, I would have to guess that there's a single quote in it causing your JS to fail. You would need to replace ' with \'. Edited October 31, 2016 by Xaotique Quote Link to comment https://forums.phpfreaks.com/topic/302398-insert-text-from-sql-to-ckeditor/#findComment-1538841 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.