views:

42

answers:

2

How to detect an event coming from the Firefox history dropdown box?

I need to distinguish between the enter key simply pressed on input field or on item from his native history dropdown box.

The reason is that I would like to call custom submit button (not first one, which is default) on the enter key pressed on any input field. But right now, the enter key pressed on history dropdown box unfortunately call submit as well.

A: 

Why not just implement a "submit" event handler and do your special stuff there?

Pointy
Thanks, it sounds as a good idea, I will try it and let you know.
banterCZ
Well, the problem of the "submit" event handler is, that I do not know how to skip a submit button, if the enter key is pressed on some input field. Anyway I want to normally call submit, if user click on the skipped button. But both use cases fire a click event.
banterCZ
When you handle the "submit" event for the form, you can return "false" from the handler and prevent the actual submit to the server.
Pointy
A: 

What about using each input's onFocus and onBlur events to dynamically change your submit code as the user shifts focus to and from your controls?

onFocus for any control sets your submit action to be action A.
onBlur for any control sets your submit action to be action B.

z5h
I afraid that this is not my case. I need something to not to call submit from the history dropdown box (which unfortunately my solution of custom submit does).
banterCZ