Detecting autocomplete on form input with jQuery

前端 未结 9 1817
闹比i
闹比i 2020-12-15 03:50

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

9条回答
  •  旧时难觅i
    2020-12-15 04:22

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

提交回复
热议问题