If you choose Men
then only the child options for Men
should show.
My footer.php:
</div>
<footer class="text-center" id="footer">©Copyright 2015-2016 Shantaus botuquo</footer>
<script>
function get_child_options(){
var parentID=jQuery('#parent').val();
jQuery.ajax({
url: '/admin/parsers/child_categories.php',
type: 'POST',
data: {parentID : parentID},
succes: function(data){
jQuery('#child').html(data);
},
error:function(){alert("Something gone wrong")},
})
}
jQuery('select[name="parent"]').change(get_child_options);
</script>
My child_categories.php:
</div>
<footer class="text-center" id="footer">©Copyright 2015-2016 Shantaus botuquo</footer>
<script>
function get_child_options(){
var parentID=jQuery('#parent').val();
jQuery.ajax({
url: '/admin/parsers/child_categories.php',
type: 'POST',
data: {parentID : parentID},
succes: function(data){
jQuery('#child').html(data);
},
error:function(){alert("Something gone wrong")},
})
}
jQuery('select[name="parent"]').change(get_child_options);
</script>
The <option>
should come back to the page to here:
div class="form-group col-md-3">
<label for="child">Child Category*:</label>
<select class="form-control" name="child" id="child">
</select>
</div>