0

I just want to value my check_list[], so it will contain array $file.

If user clicks checkbox, it will contain all the data in 1 file..

I tried to concatenate but then grouping them was a problem.

I tried hidden values, but got only 1 file values.

 @foreach($files as $file)
     <tr>
       <td><input type="checkbox" name="check_list[]" ></td>
       <td>{{ $file['file_name'] }}</td>
       <td>{{ $file['file_type'] }}</td>
        <td>{{ $file['file_modified'] }}</td>
        <td>{{ $file['file_size'] }}</td>
        <td>{{ $file['location'] }}</td>
     </tr>
   @endforeach

Pls. help Im stuck on this problem..

victorkt
  • 13,992
  • 9
  • 52
  • 51

1 Answers1

0

You can use the following approach:

var selectedvalues = new Array();
$("input[name='check_list[]']:checked").each(function() {
    selectedvalues.push($(this).val());
});

You can see other alternative ways here: Select values of checkbox group with jQuery

Community
  • 1
  • 1
renakre
  • 8,001
  • 5
  • 46
  • 99