Net apprentice
04-12-2004, 10:46 PM
Well, my first post in your forum...
Here is a rather ordinary question: how do I loop through my pull-down menu (multiple select within a form) to address multiple selected items. Right now with $_POST['items'] I get the value of the last selected item. Here's a piece of my code:
<?php
if(isset($_POST['submit'])){
echo ("<p>Items: ". $_POST['items']."</p>");
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
<label for="items">Items:</label>
<select name="items" size="3" class="textarea" multiple>
<option value="item1">item 1</option>
<option value="item2">item 2</option>
<option value="item3">item 3</option>
</select>
<input name="submit" type="submit" value="Send">
<input name="reset" type="reset" value="Reset">
</form>
I am sure there must be some pretty simple way to do this.
Any ideas?
Here is a rather ordinary question: how do I loop through my pull-down menu (multiple select within a form) to address multiple selected items. Right now with $_POST['items'] I get the value of the last selected item. Here's a piece of my code:
<?php
if(isset($_POST['submit'])){
echo ("<p>Items: ". $_POST['items']."</p>");
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
<label for="items">Items:</label>
<select name="items" size="3" class="textarea" multiple>
<option value="item1">item 1</option>
<option value="item2">item 2</option>
<option value="item3">item 3</option>
</select>
<input name="submit" type="submit" value="Send">
<input name="reset" type="reset" value="Reset">
</form>
I am sure there must be some pretty simple way to do this.
Any ideas?