Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
pass the button value from view to controller(codeigniter)

hi i have a problem when i pass the button value... when i click the button i want to show the detail depends on the button but i guess button value doesnt pass from view to controller. help,,,


//view(button)

<div class="marketer">
<?php foreach($marketer_list as $marketer){ ?>
<button  type="button"  class="mid" name= "posting_user_id" value="<?=$marketer->id?>"><?=$marketer->username?></button>
<?php }?> 
</div>
 

  $(document).ready(function () {
 
$('.mid').click(function(){
    var id = $(this).attr('value');
  alert(id);
    if (id=='<?=$detail->posting_user_id?>')
    {
      $(".show_posting").show(); 
    }else{
            alert("no info");
    }
  });
}); 
 
 
 
//controller
$posting_user_id = $this->input->post('posting_user_id');
 
 
  $data['daily'] = $result;
  $data['posting'] = $this->posting_models->get_manage_hospital_list($posting_user_id);
   $this->load->view('posting',$data);
 
//model
  function get_manage_hospital_list($posting_user_id){
    $this->db->select('u.hosp_name,p.*');
    $this->db->from('users as u');
    $this->db->join('posting_plan as p', 'u.id=p.hospital_id');
    $this->db->where('posting_user_id',$posting_user_id);
    $this->db->order_by('p.report_day','asc');
   
    return $this->db->get()->result();
  }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You haven't put an id for the button which has a class called 'mid'. Don't forget to put a unique id there. Also you have to check whether $detail->posting_user_id has a value in the view.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!