与jQuery的形式输入检测自动完成 [英] Detecting autocomplete on form input with jQuery
问题描述
我有一个检测是否所有的文本字段上的每个KEYUP有效的(形式)和重点();如果他们都是有效的,它将使为用户preSS提交按钮。但是,如果用户在使用浏览器的自动完成功能的文本输入中的一个罢了,它prevents的被启用提交按钮。
I have a form that detects if all the text-fields are valid on each keyup() and focus(); if they're all valid, it will enable the submit button for the user to press. However, if the user fills in one of the text inputs with a browsers autocomplete feature, it prevents the submit button from being enabled.
有没有一种方式,如果任何输入已经改变了,无论它是如何被改变,使用jQuery来检测?
Is there a way to detect if any of the input has changed regardless of how it's been changed, using jQuery?
推荐答案
jQuery的change事件将只能在模糊火灾。当您输入的keyup事件会触发。无论是火一个点击自动完成选项。我也寻找一种方法来检测这一点,但我目前一起去
The jQuery change event will only fire on blur. The keyup event will fire as you type. Neither fire on clicking an auto-completion option. I am also searching for a way to detect this, but I'm currently going with
$(selector).bind("change keyup",function(){
//Do something, probably with $(this).val()
});
但它并不完全解决问题...
But it doesn't quite solve the problem...
这篇关于与jQuery的形式输入检测自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!