i am facing few issues during an application of Codeigniter -- Created an function like
function searchUnivtab() {
$country = $this->input->po
function getSearchUniversity() {
country = jQuery('[name=countryKey]').val();
state = jQuery('[name=stateKey]').val();
level= jQuery('[name=level]').val();
degType= jQuery('[name=degType]').val();
jQuery.ajax({
type: "POST",
url:baseurl+ 'welcome/searchUnivtab',
cache: false,
data: {countryKey: country, stateKey: state, level: level, degType: degType},
error: function()
{
//notify('Error: Your request could be processed.. try again..!!');
},
success: function(html)
{
jQuery('[name=universityList]').html(html);
return false;
}
});
}
Remove @ in the following line to see if it produces any error so replace
$data = @$this->get->getSearchedUniversityTab($country, $state, $level, $degType[1]);
with
$data = $this->get->getSearchedUniversityTab($country, $state, $level, $degType[1]);
if(is_array($data)) {
foreach($data as $d){
$html .= '<option value="'.$d['name'].'">'.$d['name'].'</option>';
}
} else {
echo 'data is not an array.';
}