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>"
                    );                  
                 },        
            });


Messages In This Thread
insert to database from value autocomplete - by El Forum - 07-20-2011, 09:52 AM
insert to database from value autocomplete - by El Forum - 07-04-2013, 07:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB