Closed Feltim closed 1 year ago
<link href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"> <script src="https://code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script> <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js" integrity="sha256-lSjKY0/srUM9BE3dPm+c4fBo1dky2v27Gdjm2uoZaL0=" crossorigin="anonymous"></script> <script src="https://kit.fontawesome.com/16fc208f81.js" crossorigin="anonymous"></script> <link rel="stylesheet" href="./plugins/richtext/richtext.min.css"> <script src="./plugins/richtext/jquery.richtext.min.js"></script> <script language="JavaScript" type="text/JavaScript"> $(document).ready(function(){ $("#comment").richText(); $("#comment").trigger("setContent", "test"); }); </script> <textarea name="comment" id="comment"></textarea>
This is the entire script called test.php and the editor works, jquery works, the setContent does not work
Your textarea will be wrapped with nodes specific for the editor. You'd need the following code snippet to make it work:
textarea
$('#comment').siblings('.richText-editor').trigger('setContent', 'test');
This is the entire script called test.php and the editor works, jquery works, the setContent does not work