No need press enter .
i want to like that on select2 lookup fields
auto enter when only barcode scan
that is possible?
Question2 - barcode scanner with (Enable Auto Enter ) is not working on select2 box?
my trying code is
auto enter when select2 box search and result is the same
Code: Select all
$j('#item_box-container').on('select2-open',function (e){
setInterval (function(){
if($j('#s2id_item_box-container').data('select2').search.val().length){
var search = $j('#s2id_item_box-container').data('select2').search.val();
var result = $j('.select2-results .select2-highlighted').text();
if(search == result.split('/')[0]){
//$j('#item_box').val( result.id );
//i can't find select2-result id
$j('#s2id_item_box-container').select2('close');
$j('#item_box-container').change();
}
}
},5000);
});
thank you