Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 429599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:47:29+00:00 2026-05-12T19:47:29+00:00

I have a TextInput and a List in my application. I want to send

  • 0

I have a TextInput and a List in my application. I want to send the information written in TextInput and the names of the selected options from the list to a php file.

Following HTTPService sends the TextInput’s text and the indices of selected items from list finely to a php file but the selectedItems is not working as i expected. It does not send the names of the selected items

<mx:HTTPService id="configureService" url="configure.php" resultFormat="text" method="POST">
    <mx:request xmlns="">
         <textInput>
            {textInput.text}
         </textInput>
         <selectedFoodNames>
            {foodList.selectedItems.join(",")}   <!-- Problem in this LOC -->
         </selectedFoodNames>
         <selectedFoodIndices>
            {foodList.selectedIndices.join(",")}
         </selectedFoodIndices>
    </mx:request>
</mx:HTTPService>

Now, my php file results:

echo $_POST['textInput'];  //Output the right answer
echo $_POST['selectedFoodNames']; //Outputs:  "[object Object],[object Object],[object Object]" if three items are selected from the list
echo $_POST['selectedFoodIndices']; //Outputs the indices of selected items separated by comma

The list look like:

<mx:List id="foodList" x="26.95" y="54" width="231.55" height="236.9" allowMultipleSelection="true">
    <mx:dataProvider>
        <mx:Array>
                <mx:Object id="Sugar" label="Sugar" data="#FF0000"/>
            <mx:Object id="Salt" label="Salt" data="#00FF00"/>
            <mx:Object id="Pepper" label="Pepper" data="#0000FF"/>
            </mx:Array>
    </mx:dataProvider>

Is there a way i can send the labels of the elements in list?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:47:29+00:00Added an answer on May 12, 2026 at 7:47 pm

    You’ll need to write a function to make a list from the objects.

    public static function selectedItemsToLabels(list:List):String {
      var a:Array = [];
      for each(var o:Object in list.selectedItems) {
        a.push(o.label);
      }
      return a.join(",");
    }
    

    This is a static function but you can make it a member of a List if you want to extend that class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a client application where the users want to search notes fields for
I have a List with textInput as itemrenderer. Initially the list is loaded with
I have a list control where i want to show a string (thats fine)
i have a textinput field which has autoComplete, i populate its dataprovider from a
This is what i have: Main.mxml: <fx:Style source=Main.css/> <s:TextInput x=72 y=95 focusColor=#CECB02 prompt=E-mail: skinClass=components.TextInputSkin/>
I have a text input field like text box or text area. I want
Im doing something quite specific where I have a text input, I want to
I have a TextInput field that should be restricted to either capital letters, lowercase
I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]
Let's imagine I have a database and I want to programatically allow the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.