last day (14 days later) » 

12:42 PM
0
A: Clicking on a text storing the div value in session and displaying using codeigniter php

M.suleman Khanyou can use jquery to trigger onclick function on anchor <a href="#" class="applyforjob">Apply Now</a> <script> $('.applyforjob').click(function(){ var value = $('.digit').text(); window.open("<?php echo base_url();?>apply/"+value) }); </script> in the apply controller g...

 
How can we display that job name in view file
 
it is simple just pass that variable to the view file in your controller like $this->load->view('your_view',array('job_name'=>$job_name)); and in view file use $job_name where you want to print job name
 
getting error as undefined variable job_name
Updated my code with the latest one
 
make sure you are receiving $job_name variable at controller. test it by echoing $job_name at controller. if does not work then show me your code for Controller and Both Views
 
$this->load->view('your_view',array('job_name'=>$job_name)); this should be added in career controller or else in apply controller
i have placed $this->load->view('your_view',array('job_name'=>$job_name)); this line in my apply controller but it is not working
 
12:42 PM
please show your code
 
I have updated all the code controllers and view
I need to store this value in database as well
 
i have updated my Answer please check it
 
Hi
public function applynow($job_name)
{
// and store it in an array
$data = array(
'job_name' => $job_name,
);

// then pass that array to the view
$this->load->view('yourview',$data);
}
unable to understand this one
where i need to add
Are you there
can you edit it in my controller
<script>
$('.applyforjob').click(function(){

var value = $('.digit').text();
window.open("<?php echo base_url();?>apply/"+value)
});
</script>
After adding this if i click on apply now button it is opening almost 5 tabs
i mean if there are 5 jobs posted it will open 5 tabs
if it is 6 then 6 tabs
 

last day (14 days later) »