I seem to be having a strange issue where I can save to my sandbox environment in preview but not on my live site.
I’ve published the site and have been inputting data into a form on my live site when I click the button to save. The data doesn’t save on my live DB. But when I go into preview mode and input the same data and the same process. It saves in the sandbox DB.
This happened around the same time I was going back to a previous version of my site. I’ve since deleted my DB, created a new one updated the fields and elements. Made sure my elements were pulling back values and connected to the DB but still to no avail. I keep submitting my data on my live site but my live DB is empty.
export function CalculateButton_click(event) {
let Reg = {
“FirstName”: $w(“#FirstName”).value,
“LastName”: $w(“#LastName”).value,
“Email”: $w(“#Email”).value,
“Phone”: $w(“#Phone”).value,
“PostCode”: $w(“#PostCode”).value,
“Usage”: $w(“#Usage”).value,
“Direction”: $w(“#Direction”).value,
“Bill”: $w(“#Bill”).value
};
let bill = $w(“#Bill”).value;
let postCode = $w(“#PostCode”).value;
session.setItem(‘BillData’, bill);
session.setItem(‘PostCode’, postCode);
let req1 = $w(“#FirstName”).valid;
let req2 = $w(“#LastName”).valid;
let req3 = $w(“#Email”).valid;
let req4 = $w(“#Phone”).valid;
if (req1 === false || req2 === false || req3 === false || req4 === false ) {
console.log(Reg);
console.log(“Fail”);
} else {
console.log(“Pass”);
CalculateField();
$w(‘#slideshow1’).changeSlide(2);
$w(‘#group1’).expand();
wixData.save(“SolarLeading”, Reg);
}
}