javascript - Passing Data to Bootstrap Modal from database using codeigniter via AJAX -
i new codeigniter, , can't seem right. have bootstrap model should display values database. problem requirement fetch values database using ajax, , insert relevant fields[form inside modal]. know how insert data using ajax, have never used retrieve , populate something.
please can solve dilemma, i'm having problem hours now...
onclick of button, make ajax call controller.
$('#button').click( function(){ $.ajax({ type: "post", url: "your url controller function here", }).done(function( html ) { $(".bootstrap_modal").html(html); });
in controller function call model function run query , result set.
now
$data['result'] = $this->model_name->function_name(); $this->load->view('views/reveals/modal_content', $data);
Comments
Post a Comment