ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Force user to select Address from Google Map API Autocomplete result in jQuery<p>Hi&nbsp;nauna,</p> <p>The Google Places API&nbsp;currently does not support this feature.</p> <p>You could do in this way.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;asp:TextBox runat=&#34;server&#34; ID=&#34;TextBox1&#34; /&gt; &lt;input type=&#34;button&#34; id=&#34;btnSubmit&#34; name=&#34;name&#34; value=&#34;Validate&#34; /&gt; &lt;div id=&#34;dvMap&#34;&gt; &lt;/div&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://maps.googleapis.com/maps/api/js?libraries=places&amp;key=AIzaSyBE1J5Pe_GZXBR_x9TXOv6TU5vtCSmEPW4&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; var isPlaceChanged = false; google.maps.event.addDomListener(window, &#39;load&#39;, function () { var places = new google.maps.places.Autocomplete(document.getElementById(&#39;&lt;%= TextBox1.ClientID %&gt;&#39;)); google.maps.event.addListener(places, &#39;place_changed&#39;, function () { isPlaceChanged = true; var geocoder = new google.maps.Geocoder(); var place = places.getPlace(); var address = place.formatted_address; geocoder.geocode({ &#39;address&#39;: address }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { var latitude = results[0].geometry.location.lat(); var longitude = results[0].geometry.location.lng(); var mapOptions = { center: new google.maps.LatLng(latitude, longitude), zoom: 15, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById(&#34;dvMap&#34;), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(latitude, longitude), map: map }); } else { alert(&#34;Request failed.&#34;) } }); }); }); $(function () { $(&#34;#TextBox1&#34;).keydown(function () { isPlaceChanged = false; }); $(&#34;#btnSubmit&#34;).click(function () { if (!isPlaceChanged) { $(&#34;#TextBox1&#34;).val(&#39;&#39;); alert(&#34;Please Enter valid location&#34;); } else { alert($(&#34;#TextBox1&#34;).val()); } }); }); &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/6ctLcvP.gif" alt="" width="342" height="193" /></span></strong></p>https://www.aspforums.net:443/Threads/135714/Force-user-to-select-Address-from-Google-Map-API-Autocomplete-result-in-jQuery/https://www.aspforums.net:443/Threads/135714/Force-user-to-select-Address-from-Google-Map-API-Autocomplete-result-in-jQuery/Fri, 23 Nov 2018 01:59:01 GMT