$_POST and multiselectable <select> tag
- From: "Fabio" <znt.fabio@xxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 17:59:46 +0200
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
.
- Follow-Ups:
- Re: $_POST and multiselectable <select> tag
- From: ELINTPimp
- Re: $_POST and multiselectable <select> tag
- Prev by Date: Newbie question...login system
- Next by Date: Re: $_POST and multiselectable <select> tag
- Previous by thread: Newbie question...login system
- Next by thread: Re: $_POST and multiselectable <select> tag
- Index(es):