I try to save a checked value to save in database with my rebuilded html form (i had no choice to do that)
With the first input everything going well, i can update and save to database
> <input maxlength="4" size="20" type="text"
> name="appel_projet[ConfigurationAp][<?php echo $i ?>][annee_cap]"
> value="<?php echo $champs['annee_cap'] ?>"
> id="appel_projet_ConfigurationAp_<?php echo $i ?>_anne_cap">
but with the checkbox i can save nothing.. where i'm doing wrong ?
<input type="checkbox" name="appel_projet[ConfigurationAp][<?php echo $i ?>][budget_mission_cap]" id="<?php echo $i ?>_budget_mission_cap" value="<?php echo $champs['budget_mission_cap']?>" <?php echo ($champs['budget_mission_cap']== 1 ? 'checked' : '');?>>
Hope someone could help me with the checkbox
Here a part of my form :
<table>
<tbody>
<?php foreach($form[$name]->getValue() as $i => $champs): ?>
<tr>
<th><?php echo $champs['annee_cap'] ?></th>
<td>
<table>
<tbody>
<tr>
<th>
<label for="appel_projet_ConfigurationAp_<?php echo $i ?>_anne_cap">Année</label>
</th>
<td>
<input maxlength="4" size="20" type="text" name="appel_projet[ConfigurationAp][<?php echo $i ?>][annee_cap]" value="<?php echo $champs['annee_cap'] ?>" id="appel_projet_ConfigurationAp_<?php echo $i ?>_anne_cap">
</td>
</tr>
<tr>
<th>
<label for="appel_projet_ConfigurationAp_<?php echo $i ?>_budget_mission_cap">Mission</label>
</th>
<td>
<input type="checkbox" name="appel_projet[ConfigurationAp][<?php echo $i ?>][budget_mission_cap]" id="<?php echo $i ?>_budget_mission_cap" value="<?php echo $champs['budget_mission_cap']?>" <?php echo ($champs['budget_mission_cap']== 1 ? 'checked' : '');?>>
</td>
</tr>
Aucun commentaire:
Enregistrer un commentaire