(05-08-2024, 03:31 AM)Bosborne Wrote: Should this have been a new thread or are you trying to migrate from CI3 to CI4?
I'm not migrating from CI3 to CI4, i had been started with CI4 (v4.4) and now (v4.5.1) current latest version.
HTML
Code:
<!-- New Program Details -->
<div class="col-12 col-md-6 col-lg-4 col-xxl-3">
<div class="form-group mb-3">
<label for="institute" class="mb-2">Institute</label>
<?php $institutes = $appLib->getInstituteList(); ?>
<?= form_dropdown('institute', $institutes, '', 'id="institute" class="custom-select-2 mb-2" data-width="100%" required ') ?>
<span class="text-capitalize error-span text-danger ms-1 my-2 d-none"></span>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 col-xxl-3">
<div class="form-group mb-3">
<label for="degree" class="mb-2">Degree</label>
<?php $degrees = $appLib->getDegreeList(); ?>
<?= form_dropdown('degree', $degrees, ' ', 'id="degree" class="custom-select-2 mb-2" data-width="100%" required') ?>
<span class="text-capitalize error-span text-danger ms-1 my-2 d-none"></span>
</div>
</div>
JS
Code:
function getDegreeList(inst_id) {
$.ajax({
url : base_url + 'app/getDegreeList',
type: 'POST',
data: {#post_data},
dataType:'html',
success: function(data) {
$('#selectTag').html(data);
},
error: function(xhr,status,err) {
console.log('xhr => ',xhr,' Status => ',status,' Err => ',err);
},
});
}
Once the data from the server has added to the select tag, i have submit my form
PHP Code:
session()->setFlashdata()
If i'm not dynamically add options to the select tag, the below code works
PHP Code:
session()->setFlashdata()
Why i am facing this ?