Reputation: 962
I am using tinymce html editor in my form. I am getting content value by tinymce.get('elm1').getContent(); Using ajax to submit values to server. Issue is when there is empty space at start in editor it send only
to server when type is "POST", but if set type to GET then it send full content correctly. My code is below
var msg = tinymce.get('elm1').getContent();
var data = "typ=updat_sig&at=qewrasf&msg=" + msg;
$.ajax({
type: "POST",
typ: "updat_sig",
url: baseURL,
data: data,
success: function (data) {
},
dataType: "JSON"
});
Please help Thanks
Upvotes: 0
Views: 106
Reputation: 34180
Encode it before sending:
var msg = tinymce.get('elm1').getContent();
msg = encodeURIComponent(msg);
Upvotes: 1