When selecting a user in my select, I need to pass the one I selected to the fields in my form. Below is my method that takes this information.
public function LerDadosUsu(){
try{
$lerusu = "SELECT * FROM usuario ";
$listusu = $this->con->Connect()->prepare($lerusu);
$listusu->execute();
$retDados = $listusu->fetchAll(PDO::FETCH_ASSOC);
return $retDados;
}
catch(PDOException $erro_2){
echo 'erro'.$erro_2->getMessage();
}
}
Below I want to show all the user field data I selected in my select form
<div class="modal-body">
<form action="" method="post" name="frm_usuario">
<div class="form-group">
<label for="filter">Filtrar Usuário</label>
<div class="input-group"><span class="input-group-addon"><i class="fa fa-search"></i></span>
<select class="form-control" id="sel_usuario">
<!--INICIO DA PESQUISA DE DADOS COMBOBOX-->
<?php
$objeto = new Usuario();
$usuario = $objeto->LerDadosUsu();
foreach($usuario as $usuario):
?>
<option value=""> <?php print $usuario['nom_usujauport'] ?></option>
<?php
endforeach;
?>
</select>
<!--PESQUISA DADOS E RETORNA COMBOBOX-->
</div>
My question is how to pass the data I selected in the combobox to the input type="text" of my fields below Name: Email: Password: Image: