views:

40

answers:

4

Hi,

I'm using jQuery to alter things when a user enters text into an input. This works fine with .keydown() or .change() when typing.

I'm unable to capture an event when the user selects from the browser stored inputs for that field. This is the dropdown that appears when typing or on click when the element already has focus and the browser has previously entered items for this input.

Anyone know what event I can use to capture the population of the input by the browser from a stored list of previous inputs when the user clicks on one or uses the keyboard?

EDIT: As requested an example would be https://launchpad.37signals.com/highrise/signin (the Username and password, not openID). This hides the label for pasting, selecting from previous inputs or typing. I want to emulate this.

Thanks,
Denis

A: 

What about mouseup event? did you try it on the input?

Makram Saleh
+1  A: 

There's not one event triggered. As you said, it depends on how the user is using it : keyboard or mouse.

If I can remember well, keyboard approach triggers nothing. You should bind on the blur() event.

The mouseup should work for the mouse approach.

But whatever since you can bind several event at once thanks to

$("#id").bind("blur mouseup", function(){
    alert("bound !");
});
Kaaviar
+1  A: 

The change event will fire as well, but when the element looses focus.. (like it normally does)

You would have the same issue even without the browser cache, if someone use the right-mouse-click -> paste of something they had in the clipboard ...

Gaby
A: 

have a url? Not sure I quite get the question.

Senica Gonzalez