{"id":495,"date":"2022-08-30T15:02:18","date_gmt":"2022-08-30T15:02:18","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/jquery-with-autocomplete-trigger-after-selecting-an-element-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:02:18","modified_gmt":"2022-08-30T15:02:18","slug":"jquery-with-autocomplete-trigger-after-selecting-an-element-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-with-autocomplete-trigger-after-selecting-an-element-collection-of-common-programming-errors\/","title":{"rendered":"Jquery with autocomplete trigger after selecting an element-Collection of common programming errors"},"content":{"rendered":"<p>First, I believe what you are referring to is jqueryUI&#8217;s autocomplete widget. The <code>select<\/code> method fires when an autocomplete selection has been made. I&#8217;m assuming what you&#8217;re trying to do would be to display the coordinates of a geographical region chosen from the auto complete list.<\/p>\n<p>you would need to do something like this:<\/p>\n<pre><code>$('#inputbox').autocomplete({\n   select: function(event, ui){\n     \/\/ code to get selection\n     var address = $('#inputbox').text();\n     \/\/assuming your geocode is correct\n     geocoder.geocode( { 'address': address}, function(results, status) \n    {\n        if (status == google.maps.GeocoderStatus.OK)\n        {\n            alert(results[0].geometry.locations);\n        }\n    });\n   }\n\n});\n<\/code><\/pre>\n<p>For more info, see the autocomplete documentation: http:\/\/api.jqueryui.com\/autocomplete\/#event-select<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:46:24. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>First, I believe what you are referring to is jqueryUI&#8217;s autocomplete widget. The select method fires when an autocomplete selection has been made. I&#8217;m assuming what you&#8217;re trying to do would be to display the coordinates of a geographical region chosen from the auto complete list. you would need to do something like this: $(&#8216;#inputbox&#8217;).autocomplete({ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}