-1

checkbox

<div class="form-check">
    <input type="checkbox" name="IF" class="form-check-input"> 
    <label for="IF" class="form-check-label">Ingénieurie de formation</label>
    <input type="checkbox" name="DS" class="form-check-input"> 
    <label for="DS" class="form-check-label">Diagnostique Stratégique</label>
    <input type="checkbox" name="PF" class="form-check-input"> 
    <label for="PF" class="form-check-label">Plan de formation</label>
 </div>

and for my textbox I store it like this

$cl = new Client;
$cl->tel_1 = $request->input('tel_1');
ayman lys
  • 159
  • 4

3 Answers3

0

You are getting the value wrong, the index is the name attribute in html:

$cl->tel_1 = $request->input('IF');

or

<input type="checkbox" name="tel_1" class="form-check-input"> and $cl->tel_1 = $request->input('tel_1');

nyu.exe
  • 317
  • 1
  • 9
0

Use value of name attribute from checkbox.

$checkbox1 = Input::get('IF') //name="IF"

also, do not forget to add.

use Illuminate\Support\Facades\Input;

Jayant
  • 280
  • 2
  • 6
0

You can either use

$cl->tel_1 = $_POST['IF'];

Or you can use

$cl->tel_1 = $_REQUEST['IF'];

as well.