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 on TextBox Blur in jQuery<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <p>Refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&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=AIzaSyAmSZwEGMWpCdpj0_3I-IzAkyF2NOF0AD8&#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;txtPlaces&#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;) } }); }); $(&#34;#txtPlaces&#34;).blur(function () { if (!isPlaceChanged) { alert($(&#34;#txtPlaces&#34;).val()); } else { alert(&#34;Please Enter valid location&#34;); } }); }); &lt;/script&gt; &lt;span&gt;Location:&lt;/span&gt; &lt;input type=&#34;text&#34; id=&#34;txtPlaces&#34; style=&#34;width: 250px&#34; placeholder=&#34;Enter a location&#34; /&gt; &lt;asp:requiredfieldvalidator id=&#34;valName&#34; controltovalidate=&#34;txtPlaces&#34; runat=&#34;server&#34; errormessage=&#34;*Please Enter valid location&#34; forecolor=&#34;Red&#34; /&gt; &lt;div id=&#34;dvMap&#34;&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://imgur.com/yb9dxZo.gif" alt="" width="348" height="229" /></p>https://www.aspforums.net:443/Threads/847401/Force-user-to-select-Address-from-Google-Map-API-Autocomplete-result-on-TextBox-Blur-in-jQuery/https://www.aspforums.net:443/Threads/847401/Force-user-to-select-Address-from-Google-Map-API-Autocomplete-result-on-TextBox-Blur-in-jQuery/Fri, 31 May 2019 08:38:23 GMT