Jump to content

Generate List


phpnewbie81

Recommended Posts

<?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! ;D)

Link to comment
https://forums.phpfreaks.com/topic/64777-generate-list/#findComment-323182
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.