Detecting autocomplete on form input with jQuery

前端 未结 9 1811
闹比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条回答
  •  佛祖请我去吃肉
    2020-12-15 04:28

    I have a decent solution after having the same problem. Set keyup as normal to our form fields, then mouseover to the surrounding div. So once you click the autocomplete option, you mouse will be over the top of the div:

    $("#emailaddress").bind("keyup", function() {
        displayFullSubcribeForm();
    });
    
    $(".center_left_box").bind("mouseover", function() {
        displayFullSubcribeForm();
    });
    

提交回复
热议问题