1

I'm doing a display page which display data from a table and there are 3 checkbox which user can check to represents as their choice.

<tbody>@foreach($data as $d)
<?php $choice = 0 ?>
<tr>
   <td>{{$d->domain_label}}{{$d->domain_extension}}</td>
   <td>{{$d->domain_reg_date}}</td>
   <td><input type="checkbox" name="choice[]" value="R"></td>
   <td><input type="checkbox" name="choice[]" value="D"></td>
   <td><input type="checkbox" name="choice[]" value="H"></td>
   <td><a href="{{ URL::to('/postvalid2/'.$d->domain_label.'/'.$d->domain_extension)}}"><button class="btn btn-success btn-xs" type="submit">Select</button></a></td>
    </tr>@endforeach

i've tried using form to display the value for checkbox and it's working. the problem with button is i cannot bring the correct value of domain_label and domain_extension through action.

Fadhil Adzfar
  • 77
  • 1
  • 8

1 Answers1

1

You may use inputs with type hidden to send hidden data to controller

<input type="hidden" name="domain_label[<?=$d->id?>]" value="<?=$d->domain_label?>">
<input type="hidden" name="domain_extension[<?=$d->id?>]" value="<?=$d->domain_extension?>">
mochalygin
  • 739
  • 6
  • 14