0

In order to control what fields the Enter key affects, I wrote the folowing javascript which gets called on the keydown event:

function editorEnter(e)
{
    var key;
    if (window.event) key = window.event.keyCode;     //IE
    else key = e.which;                               //firefox
    if (key == 13) addEditorRow('EditorTable');
}

Here's how it is used in the context of a text field:

<input type="text" name="EditorSurname" class="EditorSurnameText" 
 value="" onkeydown="editorEnter(event);" onkeyup="EnableSave();"/>

The problem is that in FireFox with autocomplete enabled, if I select a value from the autocomplete dropdown and press enter, it does not perform the autocomplete and adds the row to the table. Is there a way to disbale the enter key functionality when selecting autocomplete?

The Alpha
  • 143,660
  • 29
  • 287
  • 307

1 Answers1

0

Check out this related question: Trap the enter key, but not when choosing the browser's autocomplete suggestion

Community
  • 1
  • 1
ryan
  • 6,541
  • 5
  • 43
  • 68