Thank you for your help. I cleaned up the code and arranged this a little differently. I have the search bar and button on one page:
import { local } from ‘wix-storage’ ;
import wixLocation from ‘wix-location’ ;
$w.onReady( function () {
});
export function searchButton_click(event, $w) {
[let](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
}) [ word = $w(](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
}) [“#searchbar”](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
}) [).value;](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
})
[ local.setItem(](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
}) [“searchWord”](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
}) [, word);](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
})
[ wixLocation.to(/buykashtools
);](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
})
[}](let word = $w(“#searchbar”).value;
local.setItem(“searchWord”, word);
wixLocation.to(/buykashtools
);
})
And the search result on another page:
import { local } from ‘wix-storage’ ;
import wixData from ‘wix-data’ ;
$w.onReady( function () {
var sameWord = local.getItem( “searchWord” );
$w( "#searchbar" ).value = sameWord;
$w( "#searchbar" ).placeholder = sameWord;
$w( '#dataset9' ).onReady( **function** () {
search();
});
});
export function searchButton_click() {
search();
}
function search() {
wixData.query( 'jobApplication02' )
.contains( '_id' , $w( "#searchbar" ).value)
.or(wixData.query( 'jobApplication02' ).contains( '_id' , $w( "#searchbar" ).value))
.find()
.then(res => {
$w( '#repeater1' ).data = res.items;
});
}
This seems to work well. Problem is, if you click on the button on the first page without adding a “searchword” Your are taken to the location, but the repeater opens all database entries (I only want one to show)
Is there a way to disable this button. so if there is no “searchword” that the button will not work? Thank You