I don't get how to change the value of an input field in a php foreach,
The value display is contain in a string array,
I want it to change when the user change page not whenever he changes the value of the field.
Any idea how to do that? any help will be welcome!
here is the code
foreach ($listeValeur as $value) {
$i ++;
?>
<form action="" method="post">
<tr>
<td>
<input onChange="this.form.submit();" name="leChamp" type="text" class="form-control" id="usr" value="<?php echo $value;?>">
</td>
<td style="text-align: center; vertical-align: middle;">
<button class="buttonNoStyle" type="submit" name="supprimerLeChoix"><i class="pointer colorIconDeleteLight iconSize fas fa-times" title="Supprimer le choix"></i></button>
<button class="buttonNoStyle" type="submit" name="supprimerTout"><i class="pointer colorIconDeleteStrong iconSize secondIconPadding fas fa-trash-alt" title="Tout supprimer"></i></button>
</td>
</tr>
</form>
<?php
}
question from:
https://stackoverflow.com/questions/65951450/how-to-change-the-value-for-the-data-we-set-of-an-input-when-we-leave-the-page 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…