phpnewbie81 Posted August 14, 2007 Share Posted August 14, 2007 hi all, Im a php newbie here. Now i want to have function called 'GenerateList' to generate a list table where the first column is a check box (to let users multiselect the record), and the rest of the colums are the field from the table. Any guide / any example for that ? Link to comment https://forums.phpfreaks.com/topic/64777-generate-list/ Share on other sites More sharing options...
php_tom Posted August 14, 2007 Share Posted August 14, 2007 <?php $fields = Array("Field1", "Field2", "Field3"); $values = Array(Array(5,4,3,2,1), Array(1,3,2,4,5), Array(1,2,3,4,5)); echo "<form action='processForm.php' method='post'>"; echo "<table><tr><td><b>Selected</b></td><td><b>Field1</b></td><td><b>Field2"; echo "</b></td><td><b>Field3</b></td></tr>"; for($i=0;$i<count($fields);$i++) { echo "<tr><td><input type='checkbox' name='check$i'></td><td>"; echo $values[0][$i]."</td><td>".$values[1][$i]."</td><td>"; echo $values[2][$i]."</td></tr>"; } echo "</table></form>"; ?> Is that what you have in mind? Hope it helps. (AAACK! it looks more like a matrix than I'm comfortable with! ) Link to comment https://forums.phpfreaks.com/topic/64777-generate-list/#findComment-323182 Share on other sites More sharing options...
phpnewbie81 Posted August 14, 2007 Author Share Posted August 14, 2007 Something like that tom .. but to be exact, this is what im looking for: http://codeigniter.com/forums/viewthread/47196/#228543 anyone can help me out ? Link to comment https://forums.phpfreaks.com/topic/64777-generate-list/#findComment-323193 Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 Just modify what Tom has given you to your needs - if you need more than that then be specific in your requirements. If you ar looking to make this an object then say so. Bottom line if you just ask for a table to list checkboxes - that is what you get... nothing more. Link to comment https://forums.phpfreaks.com/topic/64777-generate-list/#findComment-323364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.