I want to save data entered when user hit Enter key. If I use TextChanged or ValueChanged it fired after every key.
I have KetPress event and client function:
function Editor_KeyPress(sender, e) {
//Gets the code of the key that is raising the event var keyCode = e.get_keyCode();
alert(keyCode);
}
It does not fire on enter key.
Hi Arkgroup,
Thank you for posting on our forums.
By default, the KeyPress and ValueChanged client-side event should fire once you change the value of the WebTextEditor. The TextChanged client-side event fires when text in editor was changed on client and its value after postback became different from value before postback. For this reason, I don't believe the TextChanged event will fire when e.g. the 't' key is pressed. Moreover, I would like to mention that the enter key may not first the KeyPress event if the AutoPostBackFlags for EnterKeyDown is set to true (this causes a postback to occur).
To ensure I can debug the behavior you're encountering, and to provide you with the correct solution, please update this thread with the build for the Infragistics assemblies you're referencing.
I am looking forward to your update.
TextChanged event fire for every key. Still cannot catch Enter key pressed even for AutoPostBack and HideEnterKey, I am using 14.2.
Can you provide sample to catch Enter key?
Thanks
Hi,
I am currently investigating why the Key_Press event isn't working for you. In the mean time, it should be possible to use the Key_Down event instead.
I will be sure to update this thread once I have more details regarding my investigation.
After investigating this further, we found that the current behavior "onKeyPress doesn't fire when pressing enter key" is by design. More specifically, our source code is specifically checking for the enter key and cancelling the onKeyPress event. I believe this may be due to a sequence of events which for to ensure proper validation and form submissions.
Please let me know if you have any questions regarding this matter.
I have logged Development work item 206268 while we investigate this issue and will update this thread with additional details as it becomes available.