sergiodlopes / jquery-flexdatalist

Flexible input autocomplete/datalist plugin for jQuery
http://projects.sergiodinislopes.pt/flexdatalist/
MIT License
365 stars 84 forks source link

keypress event is not working #166

Open thiagojulio opened 6 years ago

thiagojulio commented 6 years ago

I'm trying to do the following event:

When the user types , be registered in the database. (if is the first letter)

$('#descricao_grupo-flexdatalist').keypress(function(e){
    console.log('keypress');
    if (e.which == 13) {
        console.log('enter');
        if($(this).val().match(/[*]/g)){
            console.log('saved');
        };
    $("#salvar_grupo").click();
    };
});

But the event is blocked because the search appears.

Look

how to make it not search if you have in the text? (if is the first letter)

thk;