U can use $(#"component_id").val and in your mapping you can just get the Val from localstorage
U can use $(#"component_id").val and in your mapping you can just get the Val from localstorage
Hi,
I am trying to get the autosearch part using google places to work.
I copied the javascript code from http://jsfiddle.net/aartyukh/2LK9H/1/ and pasted it as a onPageShow run script.
I copied the html into my page.html file in web_resources.
I also have a input palette component named "autocomplete_form".
I am expecting autosearch suggestions to appear when I test it.
Am I missing something?
Hi Shaberr,
Please follow this solution:
1 Open your app settings on "External resources" tab.
2 Take a look on "User-defined resources" part. There should be.
pre
http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places
/pre
3 If you can not find it - add it there. Details: http://prntscr.com/536jl3/direct
4 Remove previously autocomplete.
5 Add HTML component on the page.
6 Populate it with following HTML code. Details: http://prntscr.com/536jy7/direct
precode
<input id="location_input" type="text" onchange="console.log(getLatLngFromAddress(this.value));" name="location_input"class="input-prompt" placeholder="Specify where your event will happen.">
<script>
function initialize() {
console.log("google initialize");
var input = document.getElementById('location_input');
var autocomplete = new google.maps.places.Autocomplete(input);
Code: Select all
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
var location = place.geometry.location;
alert(JSON.stringify(location))
})
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
/code/pre
Regards.
error occurs
a.getAttribute is not a function.. //a is textfield..
Hello Akach,
Could you please clarify your issue with more details?
Hi Yurii Orishchuk,
Worked like a charm! Thanks for the great support!
Hey Akash , could you able to implement this autocomplete search for places ? I'm working on IONIC , if its working for , could you please share the code or screenshot of your application? it would be a great help !
Regards,
Manasa