Ckeditor value and Jquery -


i dont seem able value ckeditior, ideas im going wrong?

<textarea  class="ckeditor" id="source"></textarea>  <a href="javascript:void(0);" onclick="sendpreview()" class="porange"> send</a> 
function sendpreview() {         var value = ckeditor.instances['source'].getdata();         var model = { emailbody: source, emailto: "email@email.com", emailsubject: $(".subject").val() };         var request = $.ajax({             url: '/campaign/sendpreviewemail',             type: 'post',             datatype: 'json',             data: { model: json.stringify(model) },             cache: false,             success: function (data) {                 var dataasstring = json.stringify(data);             }         });     } 

what have works, problem because you're setting value of ckeditor value variable, using source in model. try this:

var value = ckeditor.instances['source'].getdata(); var model = {      emailbody: value, // <-- change     emailto: "email@email.com",     emailsubject: $(".subject").val()  }; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -