Welcome Guest, Not a member yet? Register   Sign In
insert to database from value autocomplete
#1

[eluser]Unknown[/eluser]
how to make the autocomplete input to the database from the previous result is a province becomes propinsi_id ...
Code:
$(this).ready( function() {
            $("#propinsi_id").autocomplete({
                  minLength: 1,
                  source:
                function(req, add){
                      $.ajax({
                        url: "<?php echo base_url(); ?>index.php/autocomplete/lookup",
                          dataType: 'json',
                          type: 'POST',
                          data: req,
                          success:    
                        function(data){
                              if(data.response =="true"){
                                 add(data.message);
                              }
                        },
                      });
                 },
             select:
                 function(event, ui) {
                    $("#result").append(
                        "<li>"+ ui.item.id + "</li>"
                    );                  
                 },        
            });
#2

[eluser]Unknown[/eluser]
please am trying to implement this in an auto complete form am working on but am not getting it though please kindly help




Theme © iAndrew 2016 - Forum software by © MyBB