Changing input before KeyCode == 13 was entered
Hi,
I am trying to re-assign a dom input element based on it's content after hitting the [enter] key.
thing is...the [enter] is executed ahead of the conditions. Confirm dialog works fine but I don't want to use any dialogs.
It's part of a chrome extension...
Here is my code:
document.onkeyup = returnKey;
function returnKey(evt)
{
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ( node.value == 'fi' ) { node.value = "כן"; }
if ( node.value == 'kt' ) { node.value = "לא"; }
}
I want to change the value of node.value,
only after that, [enter] should be executed. ( with updated value ).
Thanks,
Asaph.