• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pop up window not getting post value

#1
<button class="btn btn-sm btn-info" onclick="edit_book1(<?php echo $row['markid'];?>)"><i class="fa fa-search"></i></button>


function edit_book1(markid)
    {
      save_method = 'update';
      $('#form1')[0].reset(); // reset form on modals

      //Ajax Load data from ajax
      $.ajax({
        url : "<?php echo site_url('/Users/ajax_edit')?>/" + markid,
        type: "POST",
        dataType: "JSON",
        success: function(data)
        {

            $('[name="markid"]').val(data.markid);
           // $('[name="sel_ass"]').val(data.ass);
           
            
            $('#modal_form').modal('show'); // show bootstrap modal when complete loaded
            $('.modal-title').text('Upload'); // Set title to Bootstrap modal title

        },
        error: function (jqXHR, textStatus, errorThrown)
        {
            alert('Error get data from ajax');
        }
    });
    }

public function ajax_edit1($markid)
    {
      $data = $this->User_model->get_by_id1($markid);
     // $data = $this->User_model->get_by_id1($markid);

     echo json_encode($data);
    }

public function get_by_id1($markid)
    {
        $response = array();
        $this->db->select('*');                 
        $this->db->from('upload'); 
        $this->db->where ('markid',$markid);        
        $query = $this->db->get();
       return $query->result_array();  

    }

Error get data from ajax. kindly solve my problem
Reply


Messages In This Thread
pop up window not getting post value - by kvanaraj - 09-03-2018, 10:15 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.