Get value from textbox input and set between filter

Hi guys I’ve already created a filter with sliders. But I want to change them instead of textbox input.
I’ve followed these steps:
1- Create min and max variables to store values from textbox
2- I’ve convert variables string to number
3- Created filter wixData.Query(“TumIlanlar”).between(“fiyat”,min,max)
This is my code;

$w . onReady ( function () {
let min = Number ( $w ( “#input1” ). value )
let max = Number ( $w ( “#input2” ). value )

 $w ( "#dataset1" ). setFilter ( wixData . filter () 

. between ( “fiyat” , min , max )
)
. then (( results ) => {
console . log ( “Dataset is now filtered” );
$w ( ‘#propertyList’ ). data = results . items ; → I GET ERROR HERE PROPERTY ITEMS DOES NOT EXIST ON TYPE VOID
}). catch (( err ) => {
console . log ( err );
});

This is my design two inputbox and a button

@jonatandor35 Where is the problem?

You should run the function inside an onInput() event handler. Or if you have a filter button - inside a button.onClick() handler.

export function button14_click ( event ) {
$w . onReady ( function () {
let min = Number ( $w ( “#input1” ). value )
let max = Number ( $w ( “#input2” ). value )

    $w ( "#dataset1" ). setFilter ( wixData . filter (). between ( "fiyat" ,  min ,  max )) 

. then (( results ) => {
console . log ( “Dataset is now filtered” );
$w ( ‘#propertyList’ ). data = results . items ;
});
})

I’m still getting error :confused:

@yisrael-wix Can you help me?

@ramazanbugdayci02 You should NOT put $w.onReady() inside an event handler.