$(document).on('focus', '.sg-address', function(e) {
	var $this=$(this)
	$this
	.autocomplete({
		source: function(request, response){
			$.get(url+"api/address?q="+encodeURIComponent(request.term), function(data){
				response(data)
			}, "json");
		},
		minLength: 6,
		dataType: "json",
		cache: false,
		select: function(event, ui) {
			this.value = ui.item.label;
			// Do something with id
			if ($this.data('altfld')) $("#"+$this.data('altfld')).val(ui.item.value);
			return false;
		}
	})
});