Page 1 of 1

Multiple Column Scrolling List Box

Posted: Thu Jan 26, 2006 3:53 pm
by eatrom
Is it possible to have a multiple column (like a table) that can be embedded in a form via PHP/MySQL and allow selections of different cells?

Image

Posted: Thu Jan 26, 2006 4:06 pm
by feyd
it's sort of possible.. Possible in that it can be done. But not possible in that it is a form element. You would need a custom control that acts like a list box, but is a scrolling div (or similar) with Javascript that supports the various selection schemes you want.

Posted: Thu Jan 26, 2006 4:24 pm
by raghavan20
do you want something like this....

Code: Select all

<?php

$totalValues = 100; 
$i = 1;
while ($i < $totalValues) { 
	if ($i % ceil($totalValues/3) == 1){
?>
		<div style = 'float:left; width:100px;'>
<?php	}	?>
		<span id = '<?php echo $i; ?>' style = 'background-color:#FF4323; margin:2px; width:90px; 

text-align:center;' onclick = 'alert(document.getElementById("<?php echo $i?>").innerHTML);'>
			<?php echo "HI: ".$i; ?>
		</span><br />

<?php
	if ($i % ceil($totalValues/3) == 0){
?>
		</div>

<?php	}	
	$i++;
}

?>