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
Post a Comment