$("#SelectAFunctionFromList").change(function (event) {
debugger;
var GetValue = $(this).val();
$('#HiddenFieldForSelectedFunctionID').val(GetValue);
//reset select group
// $('#FunctionTextArea').val("");
var method = $('#FunctionPartialViewForm').attr("method").toLowerCase();
var action = $('#FunctionPartialViewForm').attr("action");
var data = $('#FunctionPartialViewForm').serialize();
$.ajax({ method: method, url: action, data: data }).done(
function (json) {
//Here I want to send my json data to my text editor called "FunctionTextArea"
alert(json);
editor .value = $("#FunctionTextArea").val(json);
});
});
jQuery(function () {
var editor = new Jodit("#FunctionTextArea");
});
$("#SelectAFunctionFromList").change(function (event) {
debugger;
var GetValue = $(this).val();
$('#HiddenFieldForSelectedFunctionID').val(GetValue);
var method = $('#FunctionPartialViewForm').attr("method").toLowerCase();
var action = $('#FunctionPartialViewForm').attr("action");
var data = $('#FunctionPartialViewForm').serialize();
$.ajax({ method: method, url: action, data: data }).done(
function (json) {
//alert(json);
//var editor = new Jodit('#FunctionTextArea');
//editor.setEditorValue('some value')
editor.value = $("#FunctionTextArea").val(JSON.stringify(json));
});
});
$("#SelectAFunctionFromList").change(function (event) {
debugger;
var GetValue = $(this).val();
$('#HiddenFieldForSelectedFunctionID').val(GetValue);
var method = $('#FunctionPartialViewForm').attr("method").toLowerCase();
var action = $('#FunctionPartialViewForm').attr("action");
var data = $('#FunctionPartialViewForm').serialize();
$.ajax({ method: method, url: action, data: data }).done(
function (json) {
//It create a new "FunctionTextArea" instead of writing to an existing one.
// If I remove the first line it will post the data to the parent window textbox instead of the "FunctionTextArea"
var editor = new Jodit('#FunctionTextArea');
editor.value = JSON.stringify(json);
});
});
Open in new window