Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda