Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put 'gmaps-output-longitude' and 'gmaps-output-latitude' to hidden field #15

Open
mirap opened this issue Dec 10, 2015 · 2 comments
Open

Comments

@mirap
Copy link

mirap commented Dec 10, 2015

Is there any simple way how to put those values into hidden fields? I'm using gmaps-autocomplete-rails in form_for, so it would be quite handy.

@kristianmandrup
Copy link
Owner

Fork it, fix it, make a PR ;)

@kristianmandrup
Copy link
Owner

I just merged some pending pull requests and looked into the code. Yes, you can use hidden fields no problem. Nothing in the code dependent on the type of field, only that the input field has a value attribute. If you have any problems, it could be due to the update_ui function using .autocomplete which you can override to fit your needs.

// fill in the UI elements with new position data
function update_ui( address, latLng ) {
  $('#gmaps-input-address').autocomplete("close");
  $('#gmaps-input-address').val(address);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants