You are here: Re: $_POST and multiselectable <select> tag « PHP Programming Language « IT news, forums, messages
Re: $_POST and multiselectable <select> tag

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация