【发布时间】:2015-02-18 01:49:57
【问题描述】:
在用户从下拉列表中选择一个选项之前,我是否可以检测到自动填充?
预期:400010 如所见。
目前我有:
$('input').on('input paste change keyup', function(event) {
if(event.type=='input'){
console.log( $(this).val() );
}
});
.. 它在用户做出选择之后起作用,但在上面的屏幕截图中看到之前不会。
【问题讨论】:
-
@DarkHorse 不,试过了,这些解决方案都不起作用。
-
澄清一下,在选择后检测到更改 is 并且该字段仍处于焦点状态,但是当用户将鼠标悬停在选项上时,我需要在选择期间更改文本.
-
出于相当明显的安全原因,您无权访问用户存储的自动填充数据
-
不幸的是,这是不可能的...... :(这是issue的报告,他们说
We do send a change event when a user chooses to autofill. I think the "bug" you're observing is that username/pw fields aren't really autofilled until the user interacts with the page (for security/privacy reasons).希望这会有所帮助。
标签: javascript jquery events autocomplete autofill