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>
in my mind, your html would be like this :
and the jquery is like this :