Okay so the code shown here at http://jsfiddle.net/PayBt/ works perfectly but I have one problem. My values CAN'T be numbers which kills the code.
HTML:
<select id="additional" name="additional" value="{{course}}">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="apatient6">6</option>
</select>
<div id="workshop1" class="formbox">stuff</div>
<div id="workshop2" class="formbox">stuff</div>
<div id="workshop3" class="formbox">stuff</div>
<div id="workshop4" class="formbox">stuff</div>
JS.
$(document).ready(function () {
$('.formbox').hide();
$('#additional').change(function () {
$('.formbox').hide();
for (i = 1; i <= $(this).val(); i++) {
$('#workshop' + i).show();
}
});
});
The options I see are make it $('#workshop' + val).show(); instead of $('#workshop' + i).show();. Or find a way to call the div's by the selectors ID's.
Basically how to show / hide multiple divs with out using numerical values?
Thanks for any help!