RE: [PHP-WIN] Multiple selection in php
| From: | Mikey | Date: | Wed, 20 Aug 2003 18:20:52 +0000 |
| Subject: | RE: [PHP-WIN] Multiple selection in php | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-21197@lists.php.net to get a copy of this message | ||
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
>