We put our igHtmlEditor inside of an HTML form and use setting "inputName" to set the name of the POST parameter.But the input the htmlEditor generates is not in sync with what is entered in the editor. It is always one keypress behind. So our customer's data is lost. Best case they lose the punctuation at the end, worst case they copy-past something in the editor and the entire value is lost.Demo: http://jsfiddle.net/cbtjf7xk/1/ -> just edit character by character and you will see the value of textarea "htmlInput" is not up-to-date
Hello Ben,
After investigating this further, I have determined that your requirement could be achieved by setting the value of a hidden input to the html editor’s content. This could be achieved by using the getContent method as follows:
html:
<input type="hidden" id="hiddenInput" value="Editors content"/>
js:
var value = $("#htmlEditor").igHtmlEditor("getContent","text");
document.getElementById("hiddenInput").value = value;
I have modified the shared sample, in order to demonstrate the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.
Regards, Monika Kirkova, Infragistics
Hi Monika,
Thanks for this workaround.Will this behavior be fixed in future releases? The inputName setting is completely useless if it cannot be relied on
The value could also be read using the inputName by accessing its sibling(the iframe) as follows:
$("textarea[name=htmlInput]")[0].previousSibling.contentDocument.children[0].outerText
Additionally, this behavior could be logged in our GitHub repository here. This will give you the opportunity do directly communicate with our development team regarding the issue and get notifications whenever a new information is available.
Please let me know if you need any further assistance regarding this matter.