I have a situation where I have multiple drop down lists that are hidden or shown depending on the situation. I will always show one of the drop down lists.
So for example, I might have something like this:
<select name="number">
<option value="1">1</option>
<option value="11">11</option>
</select>
<select name="number">
<option value="2">2</option>
<option value="22">22</option>
</select>
<select name="number">
<option value="3">3</option>
<option value="33">33</option>
</select>
Depending on the scenario, one of the drop down lists will be shown whereas the other two will be hidden. Let's say the first drop down list is shown and the other two are hidden. In my controller, I want to retrieve the select value of the drop down list that is not hidden. How would I ensure that the value of the parameter "number" is the one that is shown and not one of the hidden ones?
I could give each of the select elements a different name, but that would require extra logic behind the scenes. It may be the solution but I was just curious as to whether it was possible to give all three select elements the same name and still get the (visible) selected value.