# Listbox problem in Flash-PHP form

**URL:** https://forum.kirupa.com/t/listbox-problem-in-flash-php-form/297740
**Category:** Uncategorized
**Created:** [October 7, 2009, 9:04pm UTC](https://forum.kirupa.com/t/listbox-problem-in-flash-php-form/297740 "2009-10-07T21:04:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![adgmichael](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@adgmichael](https://forum.kirupa.com/u/adgmichael)
#### Post date: [October 7, 2009, 9:04pm UTC](https://forum.kirupa.com/t/listbox-problem-in-flash-php-form/297740/1 "2009-10-07T21:04:36Z")

</div>

This is probably a silly question, but I’m relatively inexperienced and could really use somebody’s help. I feel like I’m so close it’s really frustrating me that I can’t just get it to work!

I have a form with various lines, radio buttons, and a listbox. Everything works except that it only displays one selection from the listbox, even if they select more.

In my top frame I have this:  
//create listener object  
listListener = new Object();  
//create change function  
listListener.change = function(productsBox) {  
//create a user choice variable  
userChoice = productsBox.target.selectedItem.label;  
};  
//add the listener to the listbox component  
productsBox.addEventListener(“change”, listListener);

In the next frame down I have this:  
stop ();  
sendBtn.onRollOver = function ()  
{  
sendBtn.gotoAndPlay(2);  
};  
sendBtn.onRollOut = function ()  
{  
sendBtn.gotoAndPlay(7);  
};  
//create a loadvars object  
var sendLoad = new LoadVars();  
var receiveLoad = new LoadVars();  
sendBtn.onRelease = function ()  
{  
sendLoad.the\_title = the\_title.text;  
sendLoad.the\_name1 = the\_name1.text;  
sendLoad.the\_name2 = the\_name2.text;  
sendLoad.the\_dept = the\_dept.text;  
sendLoad.the\_address = the\_address.text;  
sendLoad.the\_address2 = the\_address2.text;  
sendLoad.the\_city = the\_city.text;  
sendLoad.the\_state = the\_state.text;  
sendLoad.the\_zip = the\_zip.text;  
sendLoad.the\_country = the\_country.text;  
sendLoad.the\_phone = the\_phone.text;  
sendLoad.the\_phone2 = the\_phone2.text;  
sendLoad.the\_fax = the\_fax.text;  
sendLoad.the\_email = the\_email.text;  
sendLoad.the\_message = the\_message.text;  
sendLoad.contactpref = contactGroup.getValue();  
sendLoad.customerstatus = customerGroup.getValue();  
sendLoad.products = userChoice;  
if (the\_name1.text == “”)  
{  
name1Dynamic.textColor = “0xFF0000”;  
name1Dynamic.text = “Name Req.”;  
}  
else if (the\_name2.text == “”)  
{  
name2Dynamic.textColor = “0xFF0000”;  
name2Dynamic.text = “Name Req.”;  
}  
else if (the\_dept.text == “”)  
{  
deptDynamic.textColor = “0xFF0000”;  
deptDynamic.text = “Dept/Co. Req.”;  
}  
else if (the\_address.text == “”)  
{  
addressDynamic.textColor = “0xFF0000”;  
addressDynamic.text = “Address Req.”;  
}  
else if (the\_city.text == “”)  
{  
cityDynamic.textColor = “0xFF0000”;  
cityDynamic.text = “City Req.”;  
}  
else if (the\_state.text == “”)  
{  
stateDynamic.textColor = “0xFF0000”;  
stateDynamic.text = “State Req.”;  
}  
else if (the\_zip.text == “”)  
{  
zipDynamic.textColor = “0xFF0000”;  
zipDynamic.text = “Zip Req.”;  
}  
else if (the\_country.text == “”)  
{  
countryDynamic.textColor = “0xFF0000”;  
countryDynamic.text = “Country Req.”;  
}  
else if (the\_phone.text == “”)  
{  
phoneDynamic.textColor = “0xFF0000”;  
phoneDynamic.text = “Phone Req.”;  
}  
else if (the\_email.text == “”)  
{  
emailDynamic.textColor = “0xFF0000”;  
emailDynamic.text = “Email Req.”;  
}  
else if (the\_message.text == “”)  
{  
messageDynamic.textColor = “0x0000FF”;  
messageDynamic.text = “How may we help you?”;  
}  
else  
{  
sendLoad.sendAndLoad(“blanketyblank.php”, receiveLoad);  
gotoAndPlay(2);  
} // end if  
};

I tried changing selectedItem to selectedItems but that just results in undefined when I test it. What am I missing?? :cry3:
