[eluser]the_unforgiven[/eluser]
Hi
I have 2 dropdowns like so
Code:
<div class="control-group" id="cat">
<label class="control-label" for="name">Category <span red;">*</span></label>
<div class="controls">
<?php echo form_dropdown('category', $categories, 'id="cat"'); ?>
</div>
</div>
<div class="style-sub-1" id="subcategory">
<div class="control-group style-sub-1">
<label class="control-label" for="name">Sub Category <span red;">*</span></label>
<div class="controls">
<?php echo form_dropdown('subcategory', $subcategories, 'id="subcategory"'); ?>
</div>
</div>
</div>
So i need some help creating that only the Category is visible to start with then the next dropdown appears based on the selection to start with and only needs to show relevant to the first option.
Can anyone help me, I know jQuery going to be best and fastest option i know the logic but struggling to write it.
Help greatly appreciated!
The html for these dropdowns are
Code:
<label class="control-label" for="name">Category <span red;">*</span></label>
<div class="controls">
<select name="category">
<option value="2">Interiors</option>
<option value="3">Woman</option>
<option value="4">Man</option>
</select>
</div>
</div>
<div class="style-sub-1" id="subcategory">
<div class="control-group style-sub-1">
<label class="control-label" for="name">Sub Category <span red;">*</span></label>
<div class="controls">
<select name="subcategory">
<option value="11">Wall Clocks</option><!-- this relates to the Interiors option
<option value="12">a sub cat of woman</option><! -- this relates to the woman option
</select> </div>
</div>
</div>
// All of which come from the db so need to know how to acheive this please!!