SOLUTION (more of a work around) Submit button submits all but file/image uploads

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.

  1. The submit button has been formatted for SUBMIT and connected to the dataset field

  2. The collection’s field is formatted for image/document as needed

  3. I have confirmed that the image/file types are compatible (ie: JPG or PGN)

  4. File/image size is well within range

  5. File/image name shows as having been selected under File Upload button

  6. Files/images can be uploaded from within collection field without issue, just not uploaded from my form page

  7. The select photo button setting is set to image

  8. The select photo button is connected to the proper field in the dataset

  9. The element is in a repeater just like all the other input elements

  10. I have code that default collapses all these elements but leaves them enabled. All code included at the bottom.

  11. 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.

  12. I have multiple datasets but only one that user input is saved to.

  13. 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],
        }
    })

   
    }

I still can use help here if you have any suggestions. I can’t figure out why only the images won’t upload.

I had the exact same issue when using a multi state box for a form when my image upload buttons were in a different state than my submit button

I solved it by moving the upload buttons to the last page, being the same page the submit button is on

From a quick glance at your code - I get the impression that depending on what option you tick, different upload buttons appear depending on different strips that expand or collapse?

If so, the solution I can think of that might work, whilst not ideal, would be to give each strip its own submit button (obviously connected to the same dataset) rather than having a single button no matter what strips are collapsed or expanded

It’s annoying, and quite obviously a bug - but I hope it at least works as a temp solution :slight_smile:

I only have one submit button so I will see if I can apply that concept to troubleshoot the problem.

You are correct in that I have several container boxes (not states but maybe they are more similar that I thought) that the user can expand and collapse depending on the data the user want to edit. And, yes, the images/documents are in their own container box. Oddly data in the other container box populate with the single update button but maybe documents/ images need special treatment (with there own submit button in their container box). I am curious to find out and will report back for others who may have the similar issues. I was initially concerned that the images may take longer to process and that references I had to the Members/Public Data collections may have caused hiccups in submissions with images/documents. This made me think I need to add additional code to account for that. Does that trigger any ideas too? Thanks for the input you opened my mind to a new potential solution.

Update…Interesting quirk!!! So, when I add an update button to the container box and click it (after selecting a new image) it populates the image element I have in the container box showing me it acknowledged my new selection. That was more progress than I had made yet. But, when I went to to collection or refreshed the page to check its permanence it reverted back to the old image like I had not made any changes. Then I tried something new. I uploaded a new image (again), clicked the submit button in the container box, THEN clicked the submit button for the whole page. That worked. It permanently replaced the old image with the new. Feels like a big quirk in the system or I just don’t understand it well enough to produce a more efficient solution. Maybe because its all in a repeater too? @prestonkelpiek9 I am so grateful for your input. Thank you for taking the time to respond. I will submit this as a potential glitch. @yisrael-wix is this of interest to you?