I have form I have made on a blank page with input fields of all types including image upload buttons.
I have done this several times in the past. These forms all have submit buttons that work properly. This time I have a problem. All user input gets updated in the collection as expected, except the images.
-
The submit button has been formatted for SUBMIT and connected to the dataset field
-
The collection’s field is formatted for image/document as needed
-
I have confirmed that the image/file types are compatible (ie: JPG or PGN)
-
File/image size is well within range
-
File/image name shows as having been selected under File Upload button
-
Files/images can be uploaded from within collection field without issue, just not uploaded from my form page
-
The select photo button setting is set to image
-
The select photo button is connected to the proper field in the dataset
-
The element is in a repeater just like all the other input elements
-
I have code that default collapses all these elements but leaves them enabled. All code included at the bottom.
-
I have code that has $w.onReady (function() {… and a $w.onReady (async() => script that retrieves nicknames from Members/PublicData and populates a dropdown element then saves the user’s choice to the dataset. I tried turning this code into a comment with /…/ to disable it to see if it was the problem. That didn’t change anything accept have that one dropdown not populate.
-
I have multiple datasets but only one that user input is saved to.
-
The page is a member’s only page with only certain roles that can access it.
Is my page just corrupt? Am I missing something? Is it my code? Thank you in advance for any ideas.
User Page with some collapsed boxes expanded
Code
import wixData from "wix-data";
$w.onReady(function () {
$w('#programs').onReady (function() {
$w('#headerTitle').scrollTo()
$w('#programList').onChange((event) => {
$w("#detailStrip").expand();
$w("#updateButton").expand();
$w("#deleteButton").expand();
$w("#newButton").expand();
});
$w('#programTitle').placeholder = "Event Name";
$w('#slug').placeholder = "web address slug";
$w('#tagline').placeholder = "Tagline for event";
$w('#sess1Title').placeholder = "Session 1 Name";
$w('#sess2Title').placeholder = "Session 2 Name";
$w('#sess3Title').placeholder = "Session 3 Name";
$w('#addressInput1,#addressInput2,#addressInput3').placeholder = "Enter Address";
$w('#L1,#L2,#L3').placeholder = "Location Name";
$w('#L1,#L2,#L3').placeholder = "Event Description. Add formatting and links as needed.";
$w('#Link1Name,#Link2Name,#Link3Name').placeholder = "Ex: Sign Up, Shop, Donate...";
$w('#link1,#link2,#link3').placeholder = "https://www.";
$w('#addSess').onChange((event) => {
let myCheckbox = $w("#addSess");
myCheckbox.checked = !myCheckbox.checked;
if ($w("#addSess").checked === true) {
$w("#sessBox").expand();
} else {
$w("#sessBox").collapse();
}
});
$w('#addEvent').onChange((event) => {
let myCheckbox = $w("#addEvent");
myCheckbox.checked = !myCheckbox.checked;
if ($w("#addEvent").checked === true) {
$w("#eventBox").expand();
} else {
$w("#eventBox").collapse();
}
});
$w('#addImages').onChange((event) => {
let myCheckbox = $w("#addImages");
myCheckbox.checked = !myCheckbox.checked;
if ($w("#addImages").checked === true) {
$w("#imageBox").expand();
$w("#gallery1").expand();
} else {
$w("#imageBox").collapse();
$w("#gallery1").collapse();
}
});
$w('#addDocuments').onChange((event) => {
let myCheckbox = $w("#addDocuments");
myCheckbox.checked = !myCheckbox.checked;
if ($w("#addDocuments").checked === true) {
$w("#documentBox").expand();
} else {
$w("#documentBox").collapse();
}
});
$w('#addLinks').onChange((event) => {
let myCheckbox = $w("#addLinks");
myCheckbox.checked = !myCheckbox.checked;
if ($w("#addLinks").checked === true) {
$w("#linkBox").expand();
} else {
$w("#linkBox").collapse();
}
});
})
});
$w.onReady(async () => {
//Clear Dropdown
$w("#leadContact").options = []
const query = await wixData
.query("Members/PublicData")
// Query the collection for any items whose "nickname" field contains
.limit(1000)
.ascending("nickname")
.find() // Run the query
const queryItems = query.items
$w("#leadContact").options = prepareDataForDropdown(queryItems, "nickname")
})
function prepareDataForDropdown(data, column) {
return data.map(item => {
return {
label: item[column],
value: item[column],
}
})
}