Re: $_POST and multiselectable <select> tag
- From: ELINTPimp <smsiebe@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 16:13:56 -0000
On Aug 31, 11:59 am, "Fabio" <znt.fa...@xxxxxxxxxxx> 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
.
- Follow-Ups:
- Re: $_POST and multiselectable <select> tag
- From: Fabio
- Re: $_POST and multiselectable <select> tag
- References:
- $_POST and multiselectable <select> tag
- From: Fabio
- $_POST and multiselectable <select> tag
- Prev by Date: $_POST and multiselectable <select> tag
- Next by Date: Re: Newbie question...login system
- Previous by thread: $_POST and multiselectable <select> tag
- Next by thread: Re: $_POST and multiselectable <select> tag
- Index(es):