I'm doing a page where i can display a list of data with checkboxes. then i will automatically check with database and if the data is there, the checkbox will be checked. What i want to do now is, lets say the checkbox is checked automatically, andwhen i unchecked it myself and save, it will update the data in database.
Example of my coding:
<form action="" method="get">
<input name="_token" type="hidden" value=""/>
@foreach($var as $v)
<table style="margin-left:20px;">
<caption></caption>
@foreach($name as $n)
<?php if($n->module_groupname == $v->module_groupname){?>
<tr><td width="80"><input type="checkbox" name="module_code[]" value=""
<?php foreach($priv as $p){
if($p->user_id == $d->id){
if($p->module_code == $n->module_code){
echo 'checked="checked"';
}
}
}?>></td>
<td width="150"></td>
<td width="200"></td>
</tr> <?php } ?>
@endforeach
</table>
<hr>
@endforeach
<input type="submit" value="select" class="btn btn-s btn-success">
</form>
i've been advised to lookup for PLUS statement oracle but i couldnt find how
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire