How do you make a user input switch enter (or change) text in a database?
I need the on/off switch to allow these profiles to display (or not display) on the live site. The page shown with the switch is only for admin on the wix dashboard. I think if I can have the switch enter ‘on’ text in the database per profile, the on-site live dynamic page will be set to filter only the profiles with ‘on’ in the selected field.
$w(“#myElement”).onChange( (event) => {
let newValue = event.target.value; // “new value”
});
FROM THE TOTALLY CODABLE FACEBOOK GROUP
Is the dashboard and live site is a same page?
it should be separate page
Drag a button on the repeater of the dashboard page
and link the button to save to that dataset
On the live site page
Select the dataset > setting > sort > select the field
set it to true
That’s it
Connect the onSwitch element to a column in your database collection that is boolean. Then like Salman says, add a button to your dashboard page (make sure it is set to read & write), on your website page make sure the dataset settings are set to filter by that column ‘is true’ (so it only displays those checked off).
thanks everyone, it works . - Emily
Thank you, this is a good idea!