Posted by ELINTPimp on 08/31/07 16:13
On Aug 31, 11:59 am, "Fabio" <znt.fa...@virgilio.it> wrote:
> Hi,
>
> If I put in the code the tag <select> that can be multiselectable (a listbox
> where I can select more that one item), how can I know what are the selected
> items?
>
> example, try this in a .php file (note the multiple="multiple" attribute):
>
> -----------------
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>
> <head>
> <title>Test page</title>
> </head>
> <body>
>
> <?php
> echo("Selected:" . $_POST["List"]);
> ?>
>
> <form id="Form" action="<?php echo(basename(__FILE__)) ?>" method="post">
> <p>
> <select name="List" size="3" multiple="multiple">
> <option value='i1'>Item 1</option>
> <option value='i2'>Item 2</option>
> <option value='i3'>Item 3</option>
> </select>
> <input type="submit" />
> </p>
> </form>
> </body>
> </html>
> -----------------
>
> If you select more that one item and press the submit button $_POST says the
> first item selected... but the oters???
> How can I know all the selected items???
>
> Thanks
Do a search on this group for select+array
[Back to original message]
|