Array for checkbox
-
I have made a form (selection of books), with multi selection checkbox. I have not added any values to them, because i am planning to show selective data in pdf only.
I have gone through all the documentation, i easily used this code to make show list of selected items./* Output in a list */ if ( is_array( $form_data['field'][1] ) ) { echo '<ul>'; foreach ( $form_data['field'][1] as $item ) { echo "<li>$item</li>"; } echo '</ul>'; }
Then i wanted to pass this data in array and show selective data using if,else statements. I used this code
<?php $book = $form_data['field'][1]; ?>
Then used this code for initial statement
<p>You have chosen <?php echo $book; ?> Here is the explanation!</p>
but is showing this statement
“You have chosen Array Here is the explanation!”From where did the array came??
Can anyone help?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Array for checkbox’ is closed to new replies.