i have an address input box and next to it i have an add button, underneath i have a repeater which has a text input and a remove button which would be used to delete the entry. i want the repeater to be hidden until the add button is click,which has a text input and a button which would be used to remove the entry . when clicking the add button i want this data to be sent to a CMS, this will store the address what has been added..
this is the issue im having. so my repeater is ticked as collapse, which is what i need, but when i type the address (which auto finds the address) once i select that address and click my add button, my repeater doesn’t appear and nothing is displayed, please see below code. i think this is the error in my code $w(“#multiInput”).value = “”;
as it says type ‘string’ is not assignable to type ‘address’
do you have a fix for this please?
here is my key or ID
addressinput = #multiInput
add button = #addButton
repeater = #inputSelectionsRepeater
deletebutton = #removeButton
text input within repeater = #inputSelections
$w.onReady(function () {
let inputSelections = [];
const populateInputRepeater = () => {
}
$w(“#inputSelectionsRepeater”) .data = inputSelections.map((selection) => ({selection, _id: Math.floor(Math.random()*1000000).toString}))
$w(“#inputSelectionsRepeater”).onItemReady (($item, itemData) => {
$item(“#inputSelections”).text = itemData.selection;
$item(“#removeButton”).onClick(() => {
inputSelections = inputSelections.filter((selection) => selection !== itemData.selection); populateInputRepeater();
})
})
$w(“#addButton”).onClick(() => {
})
const selection = $w(“#multiInput”).value;
$w(“#multiInput”).value = “”;
inputSelections.push(selection);
populateInputRepeater();
$w(“#inputSelectionsRepeater”).expand();
})