Hi,
How can I submit a form that contains igTextEditors when I press the 'Enter' key on any of the fields in the form? Like for a Login page.
I am using jquery 1.7.1, and I have tried lot of code combinations. Using both ".delegate", ".on" (since .delegate is deprecated on 1.7). Binding to keypress works for all the keys except the enter key.
I have also used the sample you guys provide and nothing. Not even alphabetic keys.
$(document).delegate("#UserName", "igtexteditorkeypress", function (evt, ui) {....
PS. I will also be using this process to do jquery ajax requests to the server (for search), so I will need the binding to work even without the default form behavior.
Any help is appreciated.
Thank You
Thank you Viktor. Im mainly using it on the login page.
Hi cperez,
I forgot to mention that most browsers do not raise keypress for actions keys like enter, esc, arrows, tab, etc.
If application is interested in processing action key events, then it should listen to keydown. Also if your application does not rely on default submit of browser on enter key, but it does all processing by itself, then there is not need to disable hideEnterKey option. The igEditor raises all browser events regardless if they are canceled by igEditor or not.
$(document).delegate("#UserName", "igtexteditorkeydown", function (evt, ui) { if (ui.key == 13) alert('enter');});
The igEditor has option hideEnterKey, which by default is enabled. That option was designed for opposite scenario: suppress possible default postback of a browser when editor had focus and enter key was pressed. That allows to select item from drop-down list by keyboard without mouse, select date in calendar of datepicker, etc.
Processing key events by application will not be able to "undo" the default stop/cancel action used by igEditor. That includes enter key. In fact, custom action might have opposite effect. If application returns false within key event-handler, then igEditor stops/cancels original event of browser and does not do its default process-key-action.
You may disable that option by$('#editor1').igEditor({ hideEnterKey: false, ...});In case of Mvc<%= Html.Infragistics().TextEditorFor(m => Model.Editor1).HideEnterKey(false).Render() %>
Any ideas on this?