I am trying to find if the enter key has been pressed. I can see the various key... events but how then do i get the keyCode ?
I am trying to find if the enter key has been pressed. I can see the various key... events but how then do i get the keyCode ?
Hello! I'm not sure I understand your question. Could you clarify please?
Did you get my email ? Anyway what I'm trying to achieve is to see if someone has pressed the enter key and if so then run the same procedure as if they had clicked on a button
You can use event.which that includes code of pressed button.
enter key keycode is equal to 13
I tried event.which and firebug says event is not defined. You have to forgive me I can barely spell javascript..
Such events probably only available when running in desktop browser. I don't think they are available in a mobile browser (as there is no keyboard).
Hi. Just finished testing a solution (for me at least). I ended up defining a new event on page load and linked it to the component. Seems to work fine so far.
This is my code (for now at least):
Tiggzi("password").keydown(function(event){
alert("Key: " + event.which);
};
oops. Minor mistake - missing a ).
Tiggzi("password").keydown(function(event){
alert("Key: " + event.which);
});
your function helps me alot.
thanks
True Marina. There are no keycodes on Android and the like