Hi guys,
I have a piece of code (below) that is working well in Firefox, but NOT working in Chrome (I have the latest version installed).
Any ideas?
export function button2_click(event, $w) {
wixData.query('Dataset_260918')
.eq('skusobnyReferenceField', $w('#text182').text)
.find()
.then(res => {
let vysledok = res.items[0];
wixData.query('Dataset_121218')
.eq('identifikator', $w('#textBox10').value)
.find()
.then(res2 => {
let vysledok2 = res2.items[0];
let toInsert = {
"referenceField": vysledok,
"title": $w('#text181').text,
"poznamka": $w('#textBox8').value,
"celkovaCena": Number($w('#input8').value),
"identifikator": vysledok2
};
wixData.insert("Dataset_MASTER", toInsert)
.then( (results) => {
let item = results; //see item below
} )
.catch((err) => {
let errorMsg = err;
});
});
});
}
Thanks,
R
Hi Yisrael, thanks for a quick response.
With the "button2" mentioned above I'm recording the form data into two datasets.
A first set of data is being recorded via form submission - with "button2" as a Submit button. This works fine.
A second set of data, including two reference fields is being recorded into a different dataset with the usage of the onClick function (the piece of code above):
When using Chrome as a browser, three fields including two reference fields (above named "referenceField", "title" & "indentifikator") are recorded properly, but the rest of data ("poznamka", "celkovaCena") is NOT recorded into the dataset and remains with the preset/zero value in the pertaining line in the dataset.
(i.e. it seems that those items with ".value" are causing the problem and are not recorded)
When trying the same in Firefox, it works fine, everything is recorded as it should be.
Thanks for your help,
R
What isn't working in Chrome. Please provide more details so that we can assist.