<div class="form-group col-sm-4">
    <label class="control-label" for="typeahead">Course Category<span style="color: red">*</span></label>
    <div class="controls">
        <select data-errormessage-value-missing="Course Category is required!" 
                class="form-control validate[required] text-input"
                id="course_category" name ="course_category_id" onchange="selectCourse(this.value, 'course_list');">
            <option value="">Select Course Category</option>
            <?php foreach ($courses_all_categories as $v_course_category) { ?>
                <option value="<?php echo $v_course_category->course_category_id; ?>"><?php echo $v_course_category->course_category_name; ?></option>
            <?php } ?>
        </select>
        
    </div>
</div>
<div id="course_list">
    <div class="form-group col-sm-4">
        <label for="course_id">Course<span style="color: red">*</span></label>
        <?php // echo $selected_course_info->course_id; ?>
        <div class="controls">
            <?php if (isset($selected_category_courses)) { ?>
                <select data-errormessage-value-missing="Plaese Select A course" 
                        class="form-control validate[required] text-input"
                        name ="course_id" id ="course_id" >
                    <option value="">Select Course</option>
                    <?php foreach ($selected_category_courses as $v_course) { ?>
                        <option value="<?php echo $v_course->course_id; ?>"><?php echo $v_course->course_name; ?></option>
                    <?php } ?>
                </select>

            <?php } else { ?>
                <select class="form-control" name ="course_id" id ="course_id" >
                    <option value="">Select Course</option>
                </select>
            <?php } ?>
        </div>

    </div>
</div>

<div id="course_batch_list" class="col-sm-12">

</div>

<div class="form-group col-sm-12 danger"><?php echo form_error('person_country'); ?></div>