Automatic field update

I currently have an application that runs 2 select.
Select 1 = Repo.all (from (c in Client, select: {c.fantasia_cliente, c.cod_cliente}, order_by: [c.fantasia_cliente]))

Select 2 = Repo.all (from (c in Client, select: {c.client_type, c.client_type, where: c.cod_client == ^ client_client))

it works perfectly.

I need the Select 2, automatic update …
As soon as select 1 modifies

Is there a way?

form.html
Select 1
<%= select(f, :cliente_pedidos, @cod_cliente, class: "form-control") %>
Select2
<%= select(f, :tipocli_pedidos, @tipo_cliente, class: "form-control") %>