Tag: autocompletetextview

自动完成在自动完成窗口中显示相关数据

我有3个输入字段,1个用于数据类型,其他2个是相关的。 当我按下数据类型字段中的按钮时,我想显示这样的自动完成窗口 而不是这个 选择之后应该看起来像这样 HTML JS $(document).on(‘focus’,’.type’,function(){ type = $(this).data(‘type’); if(type ==’vehicle’ )autoTypeNo = 1; $(this).autocomplete({ source: function( request, response ) { $.ajax({ url : ‘autocomplete.php’, dataType: “json”, method: ‘post’, data: { name_startsWith: request.term, type: type }, success: function( data ) { response( $.map( data, function( item ) { var code = item.split(“|”); return { […]