Hello Wix – Wondered if you can help;
Can the collection database insert a ‘default’ item?
I am building a database where I am requesting the viewer upload a photo. If the viewer does not submit their custom photo however, I’d like to automatically insert a default image so the area is not blank – Can you advise the process to upload a default photo when there is no “visitor photo” submitted.
Please and thank you.
Brian
That1email@yahoo.com
You don’t connect the database directly to a sea button but instead you’ll use code to save the item, here is your code.
// Declare your user image to save
let uploadedFile = $w.uploadedFile
let default = yourDefaultSrc
if(uploadedFile === '') {let img = default} else {let img = uploadedFile}
// ==> Now save img
Thank you - if someone uploads a phot as requested, does that overrride this code for the default?