Multiple Column Scrolling List Box

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eatrom
Forum Newbie
Posts: 15
Joined: Tue Jul 16, 2002 8:32 am
Location: White North of Minnesota

Multiple Column Scrolling List Box

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post 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++;
}

?>
Post Reply