<button type="submit" name="submit" tabindex="5" value="Search" class="btn btn-danger pull-right can_search"><i class="fa fa-search"></i> Search Candidate</button>
<script type="text/javascript">
jQuery( ".can_search" ).click(function() {
var jobtitle=$('#jtitle').val();
var gender=$('#gender').val();
var exp=$('#exp').val();
var nationality=$('#nationality').val();
var location=$('#location').val();
var education=$('#education').val();
var industry=$('#industry').val();
var oData = new Object();
var gender = oData.gender =gender;
var nationality = oData.nationality = nationality;
var experience = oData.experience =exp;
var location = oData.location = location;
var education = oData.education =education;
var industry = oData.industry = industry;
var jobtitle = oData.jobtitle = jobtitle;
var formURL = '<?php echo base_url(); ?>' + 'candidate/candidatesearch';//controller/method
jQuery.ajax( {
url : formURL,
type: "POST",
dataType: 'json',
data : oData,
success: function (data) {
alert('hiii');
console.log(data);
},
error: function(e){
}
});
});
</script>
public function candidatesearch()
{
$nationality=$this->input->post('nationality');
$gender=$this->input->post('gender');
$this->data["searchrecords"] =$this->candidatemodel->search_candidate($nationality,$gender,$jobtitle,$experience,$location,$education,$industry);
// print_r($this->data["searchrecords"]);exit;
$this->load->view('ajax/jobseekersearch',$this->data);
echo json_encode($data);
}
<script type="text/javascript">
jQuery( ".can_search" ).click(function() {
var jobtitle=$('#jtitle').val();
var gender=$('#gender').val();
var exp=$('#exp').val();
var nationality=$('#nationality').val();
var location=$('#location').val();
var education=$('#education').val();
var industry=$('#industry').val();
var oData = new Object();
var gender = oData.gender =gender;
var nationality = oData.nationality = nationality;
var experience = oData.experience =exp;
var location = oData.location = location;
var education = oData.education =education;
var industry = oData.industry = industry;
var jobtitle = oData.jobtitle = jobtitle;
var formURL = '<?php echo base_url(); ?>' + 'candidate/candidatesearch';//controller/method
jQuery.ajax( {
url : formURL,
type: "POST",
dataType: 'json',
data : oData,
success: function (data) {
alert('hiii');
console.log(data);
},
error: function(e){
}
});
});
</script>
public function candidatesearch()
{
$nationality=$this->input->post('nationality');
$gender=$this->input->post('gender');
$this->data["searchrecords"] =$this->candidatemodel->search_candidate($nationality,$gender,$jobtitle,$experience,$location,$education,$industry);
// print_r($this->data["searchrecords"]);exit;
$this->load->view('ajax/jobseekersearch',$this->data);
echo json_encode($data);
}
No comments:
Post a Comment