Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda