Hi. I want to disable the form for 1day after user submitted. (Same as Attendance Form). Is there anyway to do that with wix forms without custom CMS dataset?
I used this code before to disable the button.
import { local } from 'wix-storage';
import wixLocation from 'wix-location';
$w.onReady(function () {
// Get the time of the last click from local storage
let lastClicked = Number(local.getItem('lastClicked'));
// If the button was never clicked, enable the button
if (!lastClicked) {
$w("#button1").enable();
} else {
// Calculate the time passed since the last click
let timePassed = new Date().getTime() - lastClicked;
// If 24 hours (86400000 milliseconds) have not passed, disable the button
if (timePassed < 86400000) {
$w("#button1").disable();
} else {
// If 24 hours have passed, enable the button
$w("#button1").enable();
}
}
});