PHP CheckBox
Résolu
PacSuperfly
-
maka54 Messages postés 698 Date d'inscription Statut Membre Dernière intervention -
maka54 Messages postés 698 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Voici mon probleme :
while($row1 = mysql_fetch_assoc($result))
{
echo "<input type='checkbox' name='ingredients[]' id='ingredients' value='".$row1['prix']."' />";
echo $row1['ingredient']." ".$row1['prix']."  CH";
echo '<br>';
}
Comment faire pour ajouter ' checked=checked' ?
Merci beaucoup pour votre aide.
Paulo
Voici mon probleme :
while($row1 = mysql_fetch_assoc($result))
{
echo "<input type='checkbox' name='ingredients[]' id='ingredients' value='".$row1['prix']."' />";
echo $row1['ingredient']." ".$row1['prix']."  CH";
echo '<br>';
}
Comment faire pour ajouter ' checked=checked' ?
Merci beaucoup pour votre aide.
Paulo
A voir également:
- PHP CheckBox
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php - Forum Webmastering
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP
2 réponses
Merci pour ta reponse , mais si je fais ça et comme c'est dans une boucle ça va mettre toutes les options a Checked ....
echo '<input type="checkbox" name="ingredients[]" id="ingredients" value="'.$row1['prix'].'" />';
à ta place, j'écrirais plutot comme çà inversé la simple et la double quote et
checked="checked"devrait marcher soit :
echo '<input type="checkbox" name="ingredients[]" id="ingredients" value="'.$row1['prix'].'" checked="checked" />';
voilà comment faire