Click here to Skip to main content
15,916,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
am building a cms,i was able to insert into database with wysiwyg but when i want to edit previous post when i heat the edit like it take me to my edit page but the value inside the wysiwyg does not show up but every other thing is working


PHP
<blockquote class="quote"><div class="op">Quote:</div>

<script src="plugins/WYSIWYG/editor.js"></script>

<script type="text/javascript">
	$(document).ready( function() {
	$("#txtEditor").Editor();
	var textareaValue= $("#txtEditor").code();
	
	});
	</script>
	
	
	<script>
	$(document).on("click", ".txtEditor", function () {
     var myBookId = $(this).data('id');
     $(".modal-body #bookId").val( myBookId );
     // As pointed out in comments, 
     // it is superfluous to have to manually call the modal.
     // $('#addBookDialog').modal('show');
});
	</script>
<form name="my_form" action="action.php" method="POST"  enctype="multipart/form-data">
  <div class="form-group">
    <label for="exampleInputEmail1">Date</label>
    <input type="text" class="form-control" id="time" name="time"  value="" disabled>
    <small id="emailHelp" class="form-text text-muted"></small>
  </div>
  <div class="form-group">
    <label>Article Title</label>
    <input type="text" class="form-control" id="title" name="title" value="" placeholder="title" required />
  </div>
  <div class="form-group">
    <label >select categories</label>
    <select class="form-control" id="cat" name="cat">
      <option value="World">World</option>
 <option value="Sport">Sport</option>
 <option value="Politics">Politics</option>
 <option value="Business">Business</option>
 <option value="Technology">Technology</option>
 <option value="Entertainment">Entertainment</option>
 <option value="Fashion">Fashion</option>
 <option value="Gist">Gist</option>    </select>
  </div>
  
  <div class="form-group">
    <label>Write Article </label>
    <textarea class="form-control" id="txtEditor" name="txtEditor" value=""  rows="3"></textarea>
  </div>
  <div class="form-group">
    <label for="exampleInputFile">upload image</label>
    <input type="file" accept="image/*" name="myimage" id="myimage" class="form-control-file" id="exampleInputFile" aria-describedby="fileHelp">
    <small id="fileHelp" class="form-text text-muted"></small>
	
  </div>
  
  <button onclick=" $('#txtEditor').val($('.Editor-editor').html());" type="Publish" id="Publish" name="Publish" class="btn btn-primary">Publish</button>
</form></blockquote>


What I have tried:

here is what have tried so far
Posted
Updated 20-Oct-16 2:49am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900