PDA

View Full Version : Listbox Multiple Selection Form


litlengine
10-26-2006, 10:55 AM
Hi - I am trying to create a form in flash, and I have everything working except for the multiple listbox component.

My problem is this... I can get all the values to pass into another field but, I cannot get it to pass over the web correctly.

Here is an example of how it is needs to pass:
email=aa&url=aa&custentity_services_of_interest=1&custentity_services_of_interest=2&custentity_services_of_interest=3&custentity_services_budget=1&comments=z

And here is how it passes in Flash:
&custentity_services_of_interest=3,2,1

In the Flash they pass in a list (2,3,4) but I need them to come across like &custentity_services_of_interest=1&custentity_services_of_interest=2 ...etc.

Can anyone help me get this to work this way?

Thanks in advance - I am suspecting I am over thinking this...

roamingBobert
10-26-2006, 11:51 AM
The reason flash does passes the variables in such a way is so that they reach their destination. If you think of these as variables (which they are) send either via GET or POST, if you do
custentity_services_of_interest=1&custentity_services_of_interest=2&custentity_services_of_interest=3
you are going to end up with a single variable, 'custentity_services_of_interest' that is equal to the last value (three in this example) in the POST array (post neing the normal method for sending from flash)

You'll need to do some handling to break these up, either client side in flash, or server side in PHP or whatever else you are using. Take a look at string functions in both languages - I can't remember the proper one off the top of my head, but with the right one you'll be able to seperate the values using the comma as a delimeter. From there you can email or store the variables however you wish.

litlengine
10-26-2006, 05:11 PM
Thanks for the fast response - the problem is, I did create it as an array and passed the variables as 1,2,3 - but the backend system cannot understand it this way.

The system can only handle it as coming over as &custentity_services_of_interest=3&custentity_services_of_interest=2&custentity_services_of_interest=1, which is like a typical multiple selection box in standard HTML.

Any thoughts on making Flash pass the variables in the exact same format?