Jquery Mobile autocomplete using remote source

Jquery Mobile autocomplete using remote source

I have an existing autocomplete code for Desktop computer using remote php source.

My HTML is
  1. <!-- Custom Begin Date Render -->
  2. <input type="text" name="firstinput" id="firstInput" size="9" >
  3. <!-- Custom End Date Render -->
  4. <input type="text" name="secondinput" id="secodenInput" size="9" readonly="readonly"  />
Javascript
  1. var countryValue=$('#country').val();
  2.             var stateValue=$('#state').val();
  3.             var cityValue=$('#city').val();
  4.            
  5.         $("#firstinput").autocomplete({
  6.         source: "zipfinder.autocomplete.php?country=" + countryValue+"&state="+stateValue+"&city=" + cityValue,
  7.             minLength: 2,
  8.             select: function(event, ui) {
  9.             $('#secondinput').val(ui.item.secondinput);
  10.             }
  11.             });
When I type they query looks like this
  1. http://localhost/zipfinder.autocomplete.php?country=uk&state=england&city=london&term=bak
When I type a list appears and if I select anything on the list the zip code gets populated automatically in secodenInput.

The query has been performed by using mysql and php which returns json like
  1. [{"value":"Baker Street ","secondinput":"W1U"}]

If I require the similar effect as Desktop for mobile, how should I do it?