ubilabs / geocomplete

jQuery Geocoding and Places Autocomplete Plugin
http://ubilabs.github.com/geocomplete/
MIT License
1.22k stars 406 forks source link

Dynamically created geocomplete inputs #156

Closed Vitjk closed 10 years ago

Vitjk commented 10 years ago

Hi, i have a form in which user can add address inputs dynamically, i want geocomplete to handle this inputs, but it doesn't

$(".geocomplete_input2").geocomplete({details: ".form-data",map: '.map_place123'});

$(".route-middle-wrapper").on("click",".add-btn",function(){ $("#rmw"+(addbtns)).after('input type="text" value="" class="login-input route-middle geocomplete_input2">

'); $(".geocomplete_input2").trigger("geocode"); });

It's ok? Or there is an error in my code?

Vitjk commented 10 years ago

< script> $(document).ready(function(){ $("#addInput").click(function(){ $("#addInput").after(''); $(".geocomplete_input").geocomplete({ details: ".form-data", map: '.map_place123' }); }); });

it work's