How to i get a similar effect like this https://www.w3schools.com/howto/howto_js_autocomplete.asp .
I want to link on keypress with the database
See the Repeater Dropdown Autocomplete example .
Hi may i know where is $item(’ #container1 ') in your example as i cant seem to find it
i am having an issue where i cant style the box as well.
The dropdown also seems to duplicate the latest result in my database. Where it was supposed to print Primary 1 - Primary 6.
The Dropdown contents are duplicated due to an incorrect line of code. You need to use the repeater’s item scope:
You have this:
$ w (‘#name’).text = itemData.title;
But this is what you want:
$ item (‘#name’).text = itemData.title;
Hi i found another issue where when i type only one letter and click the container the repeater wont collapse. But if i type more than 1 character then the repeater will collapse.
Strange. I tried the example and all combinations (1 letter and more) work just fine. You must have some issue with your code.
Does the collapse ignore the space i have between the submit button and the input?
when i preview the site my search button is suddenly attached to the input
In the editor, move the button a little further down the page and it won’t attach. The collapse mechanism attempts to properly place components that are below a collapsed element.
A simple workaround would be to place a transparent box under the input line, and stretch the size down to where you want to place the button. The button will then start out on the page where you want it, and then when the repeater expands it will be pushed down.
Thank you for your help you have helped me solve it
i was wondering for additional feature can i make the function work again after i have selected the first container i have tried
let lastSubject = “”
$item(‘#container1’).onClick(() => {
lastChosenSubject += itemData.title;
$w(‘#input4’).value = lastChosenSubject;
$w(‘#rptDropdown’).collapse();
});
but it does not seem to work
This is A-W-E-S-O-M-E!!!
Thank you!
Old post reappearing, closed.