Hi, I've been using Wix for just about a month, I am trying to figure out how to code this. 1. If the input box is empty. show Image1 & hideRepeater1 2. if text is inputted, hide image1 & show repeater1, The inputted text in the input box will filter the items in the repeater. Done with the filtering.
the problem is if the input box is empty, it just shows the whole data from the database. Thanks in advance. here's my code
import wixLocation from 'wix-location' import wixData from 'wix-data'; $w.onReady(function () { $w("#input9").show(); $w("#button19").hide(); $w('#repeater1').hide(); });
export function input9_keyPress(event) {
let input = $w("#input9").value;
$w('#image1').hide("fade");
$w('#repeater1').show("fade");
$w("#dataset1").setFilter(wixData.filter().contains('viberPost', input));
}
Sorry was on my phone instead of the pc, this should show repeater when there is input
and hide the image
when there is no input it hide the repeater and shows the inputµ
if $w("#input9").value !== ""){
$w("#image1").expand()
$w("#repeater1.collapse()
} else {
$w("#image1").collapse'()
$w("#repeater1").expand()
$w("#dataset1").setFilter(wixData.filter().contains('viberPost',$w("#input9").value))
}