Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
335
igHtmlEditor form input always 1 keypress behind
posted

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

Parents
  • 1300
    Offline posted

    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

Reply Children