Good night, I'm having a hard time recovering a data in the I recovery but I wanted the recovery to be simultaneous. I'll explain it better and as soon as I see the code, I'll understand.
include("banco/banco.php");
$prod = $conexao_pdo->prepare(" SELECT *FROM precos ");
$prod->execute();
$result = $prod->fetchAll(PDO::FETCH_ASSOC);
I retrieve the bank information with this querry, it returns me the following information: retail_id, retail_name, total_precos, which refers to the products.
<div class="col-sm-6">
<div class="form-group">
<div class="form-line">
<select name="produto" class="form-control show-tick">
<option value="">Produto</option>
<?php foreach($result as $prod){ ?>
<option value="<?php echo $prod['nome_precos']; ?>">
<?php echo $prod['nome_precos']; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="formline">
<input type="text" class="form-control" value="" step="any" name="valor" readonly placeholder="Valor Unitario">
</div>
</div>
</div>
This snippet of code retrieves the name of the products and put inside a select for the user to choose I am having difficulties in the following part when the user choose the name the value referring to the product name go to the input unit value. p>
<div class="col-sm-2">
<div class="form-group">
<div class="form-line">
<input type="number" class="form-control" name="quantidade" required placeholder="quantidade">
</div>
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<div class="form-line">
<input type="number" class="form-control" name="total" readonly required placeholder="total">
</div>
</div>
</div>
This code above the user enters with the quantity of products he wants to acquire would like the value of the product of the above to be multiplied by the input quantity that the user entered and to return the total in the input. Anyone who can give a salve I thank you right away!