Autofill another input (templating)

hi, i wanna autofill if i already with select2 autocomplete, but if i already select it’s fill random code from server respon (of course relate with vocal search)

here’s my code

<label for=“selectCustomer” class="col-sm-2 co - Pastebin.com

`

Customers
{{-- --}}

`