Welcome Guest, Not a member yet? Register   Sign In
Make a list with ajax and php
#1

[eluser]Diegosf93[/eluser]
Hi, i have this problem i want to make a list of images with ajax look this:

Controller
Code:
public function List_Image($id="")
{

if($this->input->post("enviar"))
    {
  echo $id;

}else {
  $data['contenido']= $this->load->view('Panel_Admin/List_Image',true);
  $this->load->view('template', $data, FALSE);

  }

}

This is only a test i´m not going to the db only want to show the id.

View

Code:
<select name="" id="region">

<option value="1">Europa</option>
<option value="2">America</option>

</select>


<div id="city">

// Dynamic select

</div>
<div id="a">

</div>

<a href="[removed]void(0)">Listar</a>

JS

Code:
function Mostrar(){
var id=$("#region").val();
  
$.post("List_Image/"+id,{id:id},function(respuesta){
$("#a").html(respuesta);
  
});
  

};

When i click de button the only thing that it do is show me the view duplicate and nothing more, please help me.

Thanks


Messages In This Thread
Make a list with ajax and php - by El Forum - 10-16-2012, 03:18 PM
Make a list with ajax and php - by El Forum - 10-16-2012, 03:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB