Listbox selections into an array
Posted: Sat Jan 12, 2008 4:01 pm
I am just wondering if there is a way to put listbox selections into an array? Thanks in advance.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
foreach ($_POST as $key => $name){
print $name;//the label of the $_POST part (e.g. $_POST['name'] or $_POST[1])
print $key;//the content of the $_POST part
}
Make the form, and print_r($_POST). That'll show you exactly what the data will look like.cturner wrote:I am wanting to calculate all of the selections that are made in the listbox. So I need more information.
Or in the case of giving the <select> element the 'multiple' attribute, the selected indexes.Jcart wrote:Assuming you were infact talking about the <select></select> element, upon submission you will only receive the selected index.