javascript - Codeigniter: How to pass array from controller to view without refresh -
javascript - Codeigniter: How to pass array from controller to view without refresh -
basically have form in view 1 input enabled, , multiple inputs disabled (only show info derivated unique input).
now, need send input controller create query, , send view array fields info without refresh site (because cant loose progress have in page).
maybe solution utilize javascript send controller input field, , in function homecoming array of values refresh form, how?
edit: sorry bad english.
var input = $('#input').val(); $.ajax({ type:"post", url: <?php echo base_url().'controllername/action'?> data: {input : input}, success: function(data){ // info should contain arra $('#where_to_insert_array').html(); } });
in controller action , in action
function action() { $data = $this->input->post('input');
get info database on $data
make array , echo it
echo array(); }
javascript php ajax json codeigniter
Comments
Post a Comment