This is really useful! Thanks for sharing the code
cheesypoof wrote: I think in this case you would need to wrap the non-first cms:inputs in cms:hide and create the markup for those <select>s and <option>s manually:
- Code: Select all
<cms:input id='manufacturer' name='manufacturer' opt_values='-- Select Manufacturer --=- | Audi=audi | BMW=bmw' type='dropdown'/>
<cms:hide>
<cms:input id='series' name='series' opt_values='-- Select Series --=- | A3=a3 | A4=a4 | A5=a5 | 3 Series=3-series | 4 Series=4-series | 5 Series=5-series' type='dropdown'/>
</cms:hide>
<select id="series" name="series">
<option class="audi bmw" value="-">-- Select Series --</option>
<option class="audi" value="a3">A3</option>
<option class="audi" value="a4">A4</option>
<option class="audi" value="a5">A5</option>
<option class="bmw" value="3-series">3 Series</option>
<option class="bmw" value="4-series">4 Series</option>
<option class="bmw" value="5-series">5 Series</option>
</select>
Just wondering, will this technique work with databound forms?
I was trying it earlier and it wasn't passing the values when the form was submitted.
No worries if it doesn't work, I've worked around it with javascript, I just wondered if it was worth going back and fixing it.