I have an order form where the customer name is chosen and I would like the discount field to be filled in from this selection, this value is in the same table where the customer's registration is.
How can I make the discount field be populated from the customer's choice?
My select looks like this:
$qr2=mysqli_query($conexao,"SELECT * FROM 'clientes' order by 'nome'");
if (mysqli_num_rows($qr2)==0)
echo "Adicione ao menos um Cliente";
The field in the form where the client is chosen looks like this:
<strong><b><font size="3"> <font color="#000000">Cliente :</strong>
<select name="clienteAt"> <option value="">Selecione o Cliente</option>
<?php
while ($row=mysqli_fetch_array($qr2)){
?>
<option value="<?php echo $row['id']?>"><?php echo $row['nome']?></option>
<?php }?>
</select>
and the discount field looks like this:
<td>
<input name="desconto[]" type="text" required name="desconto"
maxlength="30" size="11" onblur="Calc(this)"
style="text-align:center"
class="desconto" />
</td>