Show/hide images when a form is submitted.

You don’t have to use Wix-Data at all.
You have already your DATASET-connected to your databse.
So write your code, to tell your dataset to save items inside the DATABASE, which is connected to your dataset.

You are using the same DATABSE

$w('#bagnallLatest').onReady(()=>{
wixData.insert('Bagnall',formData).then(()=>{

Kick out → Wix-Data-API-CODE ← of your project and replace it with CODE → related to DATASET-CODING —> using …

  1. add() —> will add a new line inside your database which is connected with your dataset
  2. setFieldValues() —> will define which FIELD-DATA you want to be saved.
  3. save(); will save your data into database with the help of DATASET
  4. onAfterSave(); will start the on AFTER-SAVE event, fired after saving process. Here you will define what to do after saving-process has been done.

As i know DATASET → it could give you anyway an ERROR, something like…

“CAN NOT REFRESH DURING SAVING-PROCESS”

You can RESOLVE THIS ISSUE BY putting some little → TIME-DELAY <— inside of the —> onAfterSave()-Code-Part.