foreach ($courses as $user) {
              $options[$user['uid']] = array(
                'coursecode' => $user['coursecode'],
                'coursename' => $user['coursename'],
                'credithours' => $user['credithours'],
                'coursetype' => $user['coursetype'],
                'building' => $user['building'],
                'place' => $user['place'],
                'day' => $user['day'],
                'time' => $user['time'],

            $form['table'] = array(
              '#type' => 'tableselect',
              '#header' => $header,
              '#options' => $options,
              '#empty' => t('No Courses found'),
              '#js_select' => FALSE,
              '#attributes' => array('checked' => 'checked'),

this code generates all courses i can register is there any way to check specific values as default i did it but not with tableselect but its look was awful so I'm trying to make it look better but I had a problem with making a specific checkboxes checked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.