Address Auto complete using Google Maps API - javascript

I am currently using google maps api to suggest addresses as user types into an input field. When they select one of the drop down suggestions provided by google, the state/province gets automatically updated.
I was wondering if there was a way to update the state/province without selecting the suggestions google provides? Maybe a user neglects to select a provided option, how do you then automatically update the state/province
example - https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform

Since the data is stored in google's database,I don't think you can update automatically if you don't click on an element of the list, because if you don't click, the google object is not created.
You can still try to convert the value of your input text into a google object but i don't think it's possible (if it is not a google.maps.places.Autocomplete object you can't use getPlace() ).
I tried it already because i was facing the same problem and din't find a solution either, maybe you will manage to convert the input into a google.maps.places.Autocomplete object. It's the only way if you want to use the data of google.

Related

Azure DevOps Extensions Copying value of one field to another field

I am trying to create Azure DevOps extension where, I want to copy(assign) value of one field to another field when the System.State is "todo". Is there a way this can by achieved using onFieldChanged event in Azure DevOps?
As shown in the image attached, I want to display the text written in System.Title in System.Description using onChange event. Is it achievable using extension?
I followed Microsoft documentation on creating simple extension using html, JavaScript, vss-extension.json. Couldn't find how the events and fields works in extensions.
We recommend that you use custom rule to copy value of one field to another field when the System.State is To Do.
Sample and result:
Update1
We can create extension to copy value of one field to another field. We can use onFieldChanged to get the field value and copy the value to another field. Here is an sample to get work item detail via the event onFieldChanged, please check it.

Angular JavaScript AutoComplete Cant Find Address Field (Add Custom Fields to AutoComplete)

I am making a little component for an app I am working on using the Google Places API and am looking to be pointed in the right direction in terms of manipulating the DOM to add a custom field above the 5 options on the Google Places AutoComplete API.
I do not think making a directive is an option here because I only have the input field for the feature. I am open to other tricks.
I am using https://www.npmjs.com/package/ngx-google-places-autocomplete for the Places API and I got everything working, but for some reason, I cannot in the life of me build the solution for adding a custom field prepended above the 5 address options on the prefill.
Anyone else dealing with this?

How to make a textbox behave like a dropdownlist using javascript

I am facing some problem. I want to make a textbox behave like a dropdownlist while the textbox still remains editable. I want the text that will have data populated from a database (like google search always shows some hints once we start writing). How can I approach this?
I think you mean an auto-filler?
http://jqueryui.com/demos/autocomplete/
The link above should provide all the answers you need. You can use this method in conjuction with ajax to give you a list based on the current value. Comment if you need more detail.

Autocomplete for textfield in Sencha Touch?

I'm making an flight search app with Sencha Touch and have encountered a small problem.
I want to create a textfield for all the airports and need autocomplete functionality for in order to make it easy for the user to choose departure airport and return airport. How can i implement this? The airports will be loaded via XML-schema and I can't seem to find any good documentation for this feature.
Thanx in advance!
Since there were no custom components out there and I needed something like this myself as well, I smashed it together.
So, here it is. Sencha Touch 2 Autocomplete Textfield component:
https://github.com/martintajur/sencha-touch-2-autocomplete-textfield
It currently uses AJAX request response for populating the autocomplete matches. It also supports custom input by the user.
When serializing the form data, the value of this type of input will be:
the selected item ID in case user has selected a matched autocomplete result
the typed text when the user has not chosen an autocomplete result
It is very basic at the moment and completely driven by own need for such a control.
Feel free to fork, modify, adapt. It's MIT-licenced.
I think you should use a searchfield instead of textfield as suggested by #Ismailp,
Then you should create a popup(a panel) in its keyup event, which should contain a list of Airports.
Go through the hidden folder list-search in the example folder in downloaded sencha framework.It shows how to search through a list.

Country/State Dynamic Drop Down List

If you go to http://profile.microsoft.com and edit your personal information, you will select your country. When a country is selected the city and/or state information changes based on what is expected for that country. Does anyone have any examples on how to accomplish this? Is there any service (free service) that provides this information?
Because you tagged your question with "jquery", here is an example of a "Depending / Cascading Selectbox" (which you are searching)
Demo
Regarding the data: Country, State, Province WebService?
The CascadingDropdown control will give you this behavior.
You have to use Javascript to dynamically populate the city/state SELECT tag whenever the country SELECT tag is changed, which you can catch using an Event Handler.
Well it's based on your IP tracking, you can find users country via his IP address, all the list of Cities, for specific countries you can find somewhere and add it to your functionality, also you probably need some ajax functions for filing up drop downs or even better a JSON.

Categories

Resources