Hello, I have a form for my members. I want to save data from this form in a database called UserInfo. To know which member has completed the form, I am taking the nickname info from PrivateMembersData and it is working fine. Then I want to store all of the datas below in an other collection. However my code doesn’t save any info from this form. I need help!!
import wixUsers from ‘wix-users’;
import wixData from ‘wix-data’;
$w.onReady( function () {
wixData.query(“Members/PrivateMembersData”)
.eq(“_id”, wixUsers.currentUser.id)
.find()
.then( (results) => {
$w(‘#input6’).value = results.items[0].nickname;
});
});
export function Submit_click(event, $w) {
$w('#dataset1').setFieldValue('nickname', $w('#input6').value);
$w('#dataset1').setFieldValue('cinsiyet', $w('#dropdown1').value);
$w('#dataset1').setFieldValue('yas', $w('#input4').value);
$w('#dataset1').setFieldValue('kilo', $w('#input5').value);
}