开发者

What events are fired when a user selects from the browsers stored form dropdown?

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 captur开发者_如何学编程e 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


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 !");
});


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 ...


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜