RE: [PHP-WIN] Multiple selection in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you mean after the page has been sent to the browser, then no, you can do
anything with PHP - you would need javascript for that.  However, if you
mean that you want certain items to appear pre-selected, the you can do it
quite simply as follows (I have chosen the simplest example, rather than the
most eloquent):

print "<select name='test_select' multiple>";
for ($i = 0; $i < 10; $i++)
{
	print "<option value='$i'";
	if ($i < 5) print " selected";
	print ">";
}

This will pre-select the first five entries, but I hope you get the gist...

Mikey

> -----Original Message-----
> From: Harpreet [mailto:harpreet@crispincorp.com]
> Sent: 19 August 2003 22:13
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Multiple selection in php
>
>
> I want to select multiple rows in a list box. I know PHP does not support
> that.What other ways can I allow user to select multiple options
> other then
> giving them check boxes for each option.
>
> Help is appreciated.
>
> Thanks
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux