Hi @yisrael-wix ,
I hope you are well,
I also hope you can help me?
I have an issue that when I have saving on a button click and moving on to the next slide I believe the date picker is resetting to its current date and when a new save is carried out on another page it saves the current date in the data collection how do I make sure that I can keep all the data from previous page saves and save it successfully to the end of the slideshow?
I provide the code below: $w(“#DOB”).value is the Date Picker
export function button98_click(event) {
let toSave = {
"_id": wixUsers.currentUser.id,
"prefix": $w("#prefix").value,
"firstName": $w("#firstName").value,
"middleName": $w("#middleName").value,
"surname": $w("#surname").value,
"mobile": $w("#mobile").value,
"telephone": $w("#telephone").value,
"email": $w("#email").value,
"dob": $w("#DOB").value,
"nino": $w("#nino").value,
"firstLineOfAddress": $w("#firstLineOfAddress").value,
"postcode": $w("#postcode").value,
"relationship": $w("#relationship").value
}
wixData.save("ProfileData", toSave)
.then((results) => {
let item = results;
})
.catch((err) => {
let errorMsg = err;
});
$w("#slideshow1").changeSlide(1);
}
export function button90_click(event) {
if ($w("#uploadButton3").value.length > 0) {
$w('#text175').expand();
$w("#text175").text = (`Uploading '${$w("#uploadButton3").value[0].name}'`);
$w("#uploadButton3").startUpload()
.then((uploadedFile) => {
$w("#text175").text = ("Upload successful");
$w("#profileImage").src = uploadedFile.url;
})
.catch((uploadError) => {
$w('#text175').expand();
$w("#text175").text = ("File upload error");
console.log(`File upload error: ${uploadError.errorCode}`);
console.log(uploadError.errorDescription);
$w('#text175').collapse();
});
} else {
$w('#button90').onClick;
$w('#text175').expand();
$w("#text175").text = ("Please choose a file to upload.");
}
}
export function button99_click(event) {
let toSave = {
"_id": wixUsers.currentUser.id,
"prefix": $w("#prefix").value,
"firstName": $w("#firstName").value,
"middleName": $w("#middleName").value,
"surname": $w("#surname").value,
"mobile": $w("#mobile").value,
"telephone": $w("#telephone").value,
"email": $w("#email").value,
"dob": $w("#DOB").value,
"nino": $w("#nino").value,
"firstLineOfAddress": $w("#firstLineOfAddress").value,
"postcode": $w("#postcode").value,
"relationship": $w("#relationship").value,
"selfie": $w("#profileImage").src
};
wixData.save("ProfileData", toSave)
.then((results) => {
let item = results; //see item below
})
.catch((err) => {
let errorMsg = err;
});
$w("#slideshow1").changeSlide(2);
}
All help appreciated.
Best wishes,
Si