Create Autocomplete from Javascript

Hello Wapplers,

I have a form with 1 auto-complete and 2 dropdowns, when the user clicks in “+ Location”, all the red area in the image below should be rendered every time the user clicks on the button.

I created a javascript function with:

var autocomplete = document.createElement("div");
autocomplete.innerHTML = (auto-complete html generated by wappler)
container.appendChild(autocomplete);

It is creating the element, but the autocomplete is not working. I tried to reload the SC and the autocomplete js file via javascript as well but still not working.

Briefly, I need to create an autocomplete field via javascript, is this possible? Or do you, guys, have an alternative to accomplish this task? Should I use createElement instead of innerHTML?

"

Thanks!

Community Page
Last updated: