please your help ,how to auto fill with ajax + select2 using medoo framework database to autofill another input in same form . this my ajax code :
$('.matrix').select2({
    ajax: {
        url: "index.php",
        dataType: 'json',
        data: function (params,page) {
            return {
                q: params.term, // search term
                qa: 'matrix'
            };
        },
        processResults: function (data,params) {
            return {
                results: $.map(data, function(obj) {
                    return { id: obj.id, text: obj.text };
                })
            };
        },
        //cache: true,
    },
    minimumInputLength: 3,
    placeholder: "<?php _e('Please Select'); ?>",
});
Please your advice .
 
                        
This my search data :