Category : checkbox

i m trying to get the number of the students filtered by campus, year and group with checkbox. this is my view. <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3">Campus</label> <div class="col-sm-9"> <div class="col-xs-6"> <div class="checkbox checkbox-danger"> <input type="checkbox" name="campus" value="1" id="1"> <label for="1"> Campus1</label> </div> </div> <div class="col-xs-6"> <div class="checkbox checkbox-danger"> <input type="checkbox" name="campus" value="2" id="2"> ..

Read more

i written a very simple code to update value of checkbox but it update 1 in db on uncheck it doesnot update 0 if request is submit here is code <div class="form-group"> <label>If it is checked it means user can only create given customer order.</label> <input type="checkbox" id="js-switch" name="customer_itself" @if($ot->customer_itself == 1) checked @endif> </div> ..

Read more

I get this error, when I submit the form SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘onloan’ cannot be null Please help. Sorry for the noob question. I’ve been searching but the examples are different. edit.blade.php <div class="form-group"> <input type="checkbox" class="" id="onloan" value="1" {{ $item->onloan == 1 ? ‘checked’ : ” }}> <label for="onloan">On Loan</label> </div> ..

Read more

I have job_sector table in which sector_id and job_id fields are there. I just want to search job_id by the sectors which I have selected through checkbox. One may select multiple sectors. My model : public function scopeSelectedOptions($query, $input = []) { if(!empty($input)) { if(array_key_exists(‘sector_id’, $input)) { $query->whereHas(‘sector_id’, function($q) use ($input) { return $q->whereIn(‘sector_id’, $input[‘sector_id’]); ..

Read more