Hi, I`m trying to get the input field values to save to the content manager but not having any success.
export function button40_click(event) { if ($w('#dropdown1').valid && $w('#datePicker5').valid && $w('#dropdown13').valid && $w('#dropdown14').valid && $w('#input26').valid && $w('#dropdown20').valid && $w('#input37').valid && $w('#input4').valid && $w('#reg').valid && $w('#make').valid && $w('#model').valid && $w('#vin').valid && $w('#input12').valid && $w('#dropdown5').valid && $w('#previouskeepers').valid && $w('#dropdown6').valid && $w('#dropdown7').valid && $w('#dropdown8').valid && $w('#dropdown9').valid && $w('#extcolour').valid && $w('#intcolour').valid && $w('#doors').valid && $w('#seats').valid && $w('#Drivechain').valid && $w('#enginecc').valid && $w('#dropdown12').valid && $w('#dropdown16').valid && $w('#dropdown17')) { let payload = { customer: $w("#dropdown1").value, totalIncVat: $w("#input4").value, vehicleReg: $w("#reg").value, make: $w("#make").value, model: $w("#model").value, variant: $w("#variant").value, body: $w("#bodytype").value, transmission: $w("#transmission").value, engine: $w("#enginenum").value, vin: $w("#vin").value, v5DocumentRef: $w("#v5ref").value, builtYear: $w("#yearofmanufacture").value, firstRegistered: $w("#Firstregistered").value, motExpiry: $w("#datePicker2").value, mlsAtLastMot: $w("#input11").value, currentMileage: $w("#input12").value, condition: $w("#dropdown5").value, manufacturersWarrantyExpiry: $w("#datePicker3").value, previousOwners: $w("#previouskeepers").value, vehicleRunning: $w("#dropdown6").value, notes: $w("#input14").value, // minPriceCapCleanPrice: $w("#").value, dateDvlaNotified: $w("#datePicker4").value, type: $w("#dropdown8").value, status: $w("#dropdown9").value, keyboardNumber: $w("#input18").value, extColour: $w("#extcolour").value, intColour: $w("#intcolour").value, doors: $w("#doors").value, seats: $w("#seats").value, drivetrain: $w("#Drivechain").value, engineCapacityCc: $w("#enginecc").value, engineSize: $w("#enginesize").value, fuelType: $w("#fueltype").value, drivePosition: $w("#driveposition").value, serviceHistory: $w("#dropdown12").value, dealership1: $w("#dropdown7").value, dateAcquired: $w("#datePicker5").value, howAcquired: $w("#dropdown13").value, // pxDealReference: $w("").value, purchasedBy: $w("#dropdown14").value, purchasePrice: $w("#input37").value, purchaseCoaRef: $w("#text60").text, hasOutstandingFinance: $w("#dropdown16").value, financeProvider: $w("#input28").value, financeAccountNumber: $w("#input29").value, financeOutstanding: $w("#input30").value, vdi: $w("#input31").value, insuranceWriteOff: $w("#dropdown17").value, insuranceWriteOffCategory: $w("#dropdown18").value, writeOffNotes: $w("#input32").value, }; payload.save(); } else { console.log("error occurred"); } }
Can anyone help please?
@Jordan Norman It's unclear from your post whether or not you are using a dataset with this page. If so, you could use the wix-dataset API's save function. Otherwise, you would use the wixData API's save function.