0
I would like to know how to update a select
with data from another.
I currently use SQL, I already have a connection created:
$connection = new COM("ADODB.Connection"); //instancia a classe de conexao
$connection->Open("PROVIDER=SQLOLEDB;Data Source=.;Initial Catalog=ADM;User ID=userxxx; Password=userxxx"); //estabelece conexão com MSSQL
<select>
<option value="01">Empresa Construção</option>
<option value="02">Empresa Prod Beleza</option>
<option value="03">Empresa agricola</option>
<option value="04"selected>Empresa comida</option>
</select>
I would like, when selecting one of the companies (for example "Construction Company"), to automatically search my bank for the information in the table and return by filling out the below automatically, with the information relating only to this company.
<select>
<option value="01">Tintas</option>
<option value="02">madeira</option>
<option value="03">Cimento</option>
<option value="04"selected>Pedra</option>
</select>
You will do this with ajax, in the change event of the first select you run ajax take the dice and play in the second select.
– Kayo Bruno
I’m sorry, I’m new at this and I don’t quite understand, I didn’t get to perform anything with Ajax
– Robson
Read this article: https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX/Getting_Started
– Kayo Bruno