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..

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

3 Comments

i like your idea, but it doesnt work. can i foreach my value in checkbox?
do you think it is because you dynamically generate the checkboxes?
so how can i get it then?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.