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?