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 8824593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:40:21+00:00 2026-06-14T06:40:21+00:00

Question: How do I get the value from each dropdown and concatenate them to

  • 0

Question:

How do I get the value from each dropdown and concatenate them to create a string of characters from those values? These dropdowns are dynamically generated so I cannot select them by ID etc.

Details:

I have a list on n number of dropdowns depending on the product selected.
Each dropdown is related to a character in a partnumber thus whichever is selected builds a string of characters to a variable to create a part number i.e. “B119”
Edit (include code):

    <dt>
    <dd>
        <select class="ddlmain" name="product_attribute_180_3_17" id="product_attribute_180_3_17">
            <option value="0">---</option>
            <option value="B">Blue</option>
            <option value="G">Green</option>
            <option value="R">Red</option>
        </select>
    </dd>
</dt>
<dt>
    <dd>
        <select class="ddlmain" name="product_attribute_180_1_18" id="product_attribute_180_1_18">
            <option value="0">---</option>
            <option value="119">Left</option>
            <option value="120">Right</option>
            <option value="121">Center</option>
        </select>
    </dd>
</dt>
  • 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-06-14T06:40:22+00:00Added an answer on June 14, 2026 at 6:40 am
    1. you can give the group of dropdowns a specific class name.
    2. use the classname as selector. iterate them and get it’s value. concat the value to a variable.

    in my mind, your html would be like this :

    <select class="dropdownCode code_1" id="code_1">
        <option value="">select</option>
        <option value="1">one</option>
        <option value="2">two</option>
        <option value="3">tiga</option>
    </select>    
    
    <select class="dropdownCode code_2" id="code_2">
        <option value="">select</option>
        <option value="alpha">alpha</option>
        <option value="omega">omega</option>    
    </select>    
    
    <select class="dropdownCode code_3" id="code_3">
        <option value="">select</option>
        <option value="X">X</option>
        <option value="Y">Y</option>
        <option value="Z">Z</option>
    </select>    
    
    <button class="create">Create</button>
    

    and the jquery is like this :

    var returnVal = '';
    $('.create').click(function() {
       $('.dropdownCode').each(function() {
           returnVal += $(this).val();
       });                    
       alert(returnVal);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very basic question - how to get one value from a generator in Python?
From my question at Get Foreign Key Value , I managed to get the
I have a very simple question, How can I get the POST values from
HTML Javascript question to get the selected value of a input-select I can use
I was looking for an anwer to question Get next N elements from enumerable
I tried to get the value of rel on each li and pass it
You can't use Enumerable#map to look up the same value from each element an
I am wondering how I can get the value from an asp.net textbox that
Possible Duplicate: Enums returning int value How to get the numeric value from the
So i'm trying to just get a value extracted from my XML, the whole

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.