Welcome Guest, Not a member yet? Register   Sign In
jQuery UI Autocomplete with CI ??
#46

[eluser]kakap[/eluser]
hello guys, i need your help Smile this is my scripts

controller:
Code:
function film_lookup() {
        
        //ambil judul film
        $this->load->model('mfilm');
        
        $keyword = $this->input->post('term');
        
        $data['response'] = 'false';
        
        $query = $this->mfilm->getFilmTitle($keyword);
        
        if (!empty($query)) {
            
            $data['response'] = 'true';
            $data['message'] = array();
            
            foreach ($query as $row) {
                
                $data['message'][] = array(
                                     'id' => $row->id_film,
                                     'value' => $row->judul_film,
                                     ''
                                     );
                
            }
            
        }
        
        if ('IS_AJAX') {
            
            echo json_encode($data);
            
        }
    }

my model:
Code:
function getFilmTitle($keyword) {
        
        //autocomplete
        $this->db->select('id_film, judul_film')->from('film')
                 ->where('show', '1')
                 ->like('judul_film', $keyword, 'after');
                
        $Q = $this->db->get();
        
        return $Q->result();
        
    }

my view:

Code:
[removed]
        $(this).ready(function() {
            
        $("#judul_film").autocomplete({
        
        minLength: 1,
        source: function(req, add) {
            
            $.ajax({
                
                url: "<?php echo base_url();?>index.php/member/film_lookup",
                dataType: 'json',
                type: 'POST',
                data: req,
                success: function(data) {
                    
                    if (data.response == 'true') {
                        
                        add(data.message);
                        
                    }
                    
                },
                
            });
            
        },      
                      
    });
            
    });
    [removed]

<?php echo form_open('member/create_review');?>
    <p><label>Judul Film</label><br />
    &lt;?php
    $data = array('name' => 'judul_film', 'id' => 'judul_film', 'size' => '50');
    echo form_input($data);
?&gt;

autocomplete is already running, but i want to store 'id_film' to database, not 'judul_film'. how to change form input value to 'id_film'?

thanks for your help

judul_film = title_film Smile


Messages In This Thread
jQuery UI Autocomplete with CI ?? - by El Forum - 04-30-2010, 07:22 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 03:27 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 04:21 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 04:25 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 05:15 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 05:34 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 05:41 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 10:13 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 10:20 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 11:36 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-01-2010, 08:46 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-02-2010, 09:19 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-02-2010, 09:41 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-02-2010, 09:02 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 05-02-2010, 09:08 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-08-2010, 12:39 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-08-2010, 01:01 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-08-2010, 06:29 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-08-2010, 06:56 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-09-2010, 09:18 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-09-2010, 10:01 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 06-09-2010, 10:53 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 01:45 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 02:15 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 03:23 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 03:25 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 03:33 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-02-2010, 09:08 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 09-08-2010, 11:40 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 09-09-2010, 06:39 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 09-09-2010, 06:50 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 09-09-2010, 11:25 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 09-10-2010, 06:52 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-03-2010, 11:43 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-03-2010, 12:20 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-03-2010, 03:07 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-03-2010, 03:14 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-08-2010, 12:20 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-08-2010, 02:02 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-08-2010, 02:27 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-08-2010, 03:29 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-08-2010, 06:53 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-20-2010, 01:22 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-20-2010, 01:53 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 10-20-2010, 02:01 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-15-2011, 10:46 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-15-2011, 10:59 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-15-2011, 11:57 AM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-27-2011, 12:59 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-27-2011, 01:25 PM
jQuery UI Autocomplete with CI ?? - by El Forum - 07-27-2011, 02:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB