Issue
I have database like this:
column cek for define checkbox with code like this:
<input type="checkbox" value="{{ ($d->kd == $d->cek ? '0' : '1') }}" name="ada[]" @if($d->cek) checked @endif>
When its checked it will gave value '1', and when its unchecked its supposed to give value '0' but instead '0' i got null. Anyone here how should it? Thank you.
Solution
<input type="checkbox" value="{{ ($d->kd == $d->cek ? '0' : '1') }}"
name="ada[]" @if($d->kd == '1') checked @endif >
Answered By - simpson
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.