I am building a table with checkboxes without using tableselect for various reasons, but am trying to retrieve the checkbox value similar to how tableselect does. Tableselect will populate the
values array in
$form_state at form submission. A key with the name of the form in
values contains the list of selected rows. I attempted to reverse engineer how tableselect populates the
values array, but couldn’t really come up with anything other than
values array using the below element is unpopulated when the form is submitted.
This is some of the form builder I’m using right now. It exists in the
buildForm(array $form, FormStateInterface $form_state) function.
$rows($nid) = ( 'check' => ( 'data' => ( '#type' => 'checkbox', '#title' => 'test2', '#return_value' => '$nid', ) ), ), ... $form('table') = array( '#type' => 'table', '#header' => $header, '#rows' => $rows, );