0

I would like to copy the user-selected option from one "select" to another "select". I want to do this because I cannot edit the first "select" but I need the information from it.

The first select has an Id of "product-select-option-1". This is the second select:

 <label for="Material">Material</label>
   <select id="Material" name="attributes[Material]" size="1">    
    <option value=" " selected="selected">Choose your Material</option>
    <option value="0">Cotton</option>
    <option value="1">Silk</option>
    <option value="2">Tafetta</option>
    <option value="3">Chiffon</option>
   </select>

Any help would be massively appreciated! Thank you!

Edmond Tam
  • 15
  • 5
  • And how did your attempt go? – PSL May 19 '13 at 09:09
  • Are you asking how to add a new, extra select option to the second select based on what was selected in the first? Or are the options the same in both and you just want to make sure that if the user chooses, say, "Tafetta" in the first select that you make that the selected option in the second select? – nnnnnn May 19 '13 at 09:10
  • _"I want to do this because I cannot edit the first "select" but I need the information from it."_ - I don't understand the point you're making here. How does copying something into the second select help you with getting information from the first? – nnnnnn May 19 '13 at 09:12
  • please change your question to make it clear what you want to achieve, not what you're trying to do to achieve that. If you have JS access to the page, you can edit the first select as much as you want, so you probably mean something else, but aren't telling us. Getting information from the select element is pretty easy, so what are you trying to achieve for which simply reading out the select element's data is not enough? – Mike 'Pomax' Kamermans May 19 '13 at 14:53
  • Hi all, sorry for the late response. Basically, what "nnnnnn" says is right - the options are the same for both. In the first select, the user chooses "Tafetta" and I want that to be reflected in my second select. Is there any code for this? – Edmond Tam May 19 '13 at 19:20

0 Answers0