lulu50
asked on
Sending data from dialog box to the index page text editor
Hi,
1. I have an index page
2. I have a dialog window
3. I want to send data from my dialog window to the index page
I'm unable to send my data from the dialog box to the index page text editor.
1. I have an index page
2. I have a dialog window
3. I want to send data from my dialog window to the index page
I'm unable to send my data from the dialog box to the index page text editor.
index page:
text editor
jQuery(function () {
var maxLength4000 = 4000;
$(document).on("keyup paste touchend", function () {
var text = $("#ActionAttributesAndValues").val();
var textlen = maxLength4000 - text.length;
if (text.length > 4000) {
editorActionAttributesAndValues.value = text.substr(0, 4000);
}
$('#rcharsActionAttributesAndValues').text(textlen);
if ($("#ActionAttributesAndValues").val() != '') {
$('#ValidateActionAttributesAndValues').hide();
}
else {
$('#ValidateActionAttributesAndValues').show();
}
});
var editorActionAttributesAndValues = new Jodit("#ActionAttributesAndValues");
});
@Html.TextArea("ActionAttributesAndValues", new { @class = "form-control", @style = "width:77%" })
Dialog window:
$("#AppendAttributeToParentBtn").click(function () {
debugger;
// I want to populate the editor Attribute value to Attribute text editor.
// it's not working
var textareavalue = editorAttributeTextArea.value;
alert(textareavalue); //I'm getting the data from the text area but I'm unable to send my data to the index page where I have the editor for attribute text editor
editorActionAttributesAndValues.value = editorActionAttributesAndValues.value + '<br/>' + textareavalue;
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Maybe because I have two text editors on the index page
first one
If I do:
editor.value = editor.value + '<br/>' + textareavalue;
it will go to the first text editor but not the second
I want it to go to the second text editor.
editorActionAttributesAndV alues.valu e = editorActionAttributesAndV alues.valu e + '<br/>' + textareavalue;
first one
jQuery(function () {
var maxLength4000 = 4000;
$(document).on("keyup paste touchend", function () {
var text = $("#ConditionAttributesAndValues").val();
var textlen = maxLength4000 - text.length;
if (text.length > 4000) {
editor.value = text.substr(0, 4000);
}
$('#rcharsConditionAttributesAndValues').text(textlen);
if ($("#ConditionAttributesAndValues").val() != '') {
$('#ValidateConditionAttributesAndValues').hide();
}
else {
$('#ValidateConditionAttributesAndValues').show();
}
});
editor = new Jodit("#ConditionAttributesAndValues");
});
var editorActionAttributesAndValues = null;
jQuery(function () {
var maxLength4000 = 4000;
$(document).on("keyup paste touchend", function () {
var text = $("#ActionAttributesAndValues").val();
var textlen = maxLength4000 - text.length;
if (text.length > 4000) {
editorActionAttributesAndValues.value = text.substr(0, 4000);
}
$('#rcharsActionAttributesAndValues').text(textlen);
if ($("#ActionAttributesAndValues").val() != '') {
$('#ValidateActionAttributesAndValues').hide();
}
else {
$('#ValidateActionAttributesAndValues').show();
}
});
// var editorActionAttributesAndValues = new Jodit("#ActionAttributesAndValues");
editorActionAttributesAndValues = new Jodit("#ActionAttributesAndValues");
});
If I do:
editor.value = editor.value + '<br/>' + textareavalue;
it will go to the first text editor but not the second
I want it to go to the second text editor.
editorActionAttributesAndV
ASKER
Hi,
It worked!!!!
It worked!!!!
var editorActionAttributesAndValues = null;
jQuery(function () {
var maxLength4000 = 4000;
$(document).on("keyup paste touchend", function () {
var text = $("#ActionAttributesAndValues").val();
var textlen = maxLength4000 - text.length;
if (text.length > 4000) {
editorActionAttributesAndValues.value = text.substr(0, 4000);
}
$('#rcharsActionAttributesAndValues').text(textlen);
if ($("#ActionAttributesAndValues").val() != '') {
$('#ValidateActionAttributesAndValues').hide();
}
else {
$('#ValidateActionAttributesAndValues').show();
}
});
editor.editorActionAttributesAndValues = new Jodit("#ActionAttributesAndValues");
});
$("#AppendAttributeToParentBtn").click(function () {
var textareavalue = editorAttributeTextArea.value;
editor.editorActionAttributesAndValues.value = editor.editorActionAttributesAndValues.value + '<br/>' + textareavalue;
});
ASKER
Thank you so much!!!!
This is great!!!!
Thank you for all your help.
Thanks,
Lulu50
This is great!!!!
Thank you for all your help.
Thanks,
Lulu50
you welcome
ASKER
Unhandled exception at line 59, column 13 in eval code
0x800a1391 - JavaScript runtime error: 'editorActionAttributesAnd
Open in new window