Any event triggered on autocomplete?

前端 未结 8 1935
余生分开走
余生分开走 2020-11-27 15:39

I have a pretty simple form. When the user types in an input field, I want to update what they\'ve typed somewhere else on the page. This all works fine. I\'ve bound the

相关标签:
8条回答
  • 2020-11-27 16:12

    Here is an awesome solution.

    $('html').bind('input', function() {
        alert('test');
    });
    

    I tested with Chrome and Firefox and it will also work for other browsers.

    I have tried a lot of events with many elements but only this is triggered when you select from autocomplete.

    Hope it will save some one's time.

    0 讨论(0)
  • 2020-11-27 16:13

    Detecting autocomplete on form input with jQuery OR JAVASCRIPT

    Using: Event input. To select (input or textarea) value suggestions

    FOR EXAMPLE FOR JQUERY:

    $(input).on('input', function() { 
    alert("Number selected ");
    

    });

    FOR EXAMPLE FOR JAVASCRIPT:

    <input type="text"  onInput="affiche(document.getElementById('something').text)" name="Somthing" />
    

    This start ajax query ...

    0 讨论(0)
提交回复
热议问题