Hi Simonas. Like I mentioned before, I am very new to wix code, and I am trying to put everything together. As you see below, it is still giving that “memberID is undefined” message.
The “clientType” is the key to the membership column in my collection.
It is still not saving the selected membership in the collection.
What am I missing?
This is the coding I have on my page at the moment:
import wixData from ‘wix-data’;
import wixUsers from ‘wix-users’;
$w.onReady( function () {
//TODO: write your page related code here…
$w(“#wixVisitors1”).hide();
$w(“#columnStrip7”).hide();
$w(“#socialBar2”).hide();
$w(“#mobileMenu1”).hide();
let user = wixUsers.currentUser;
$w(‘#dropdown4’).onChange( function (e) {
const dropdown = e.target;
const membershipId = dropdown.options[dropdown.selectedIndex].value;
wixData.update(‘Members’, { _id: memberId, clientType: membershipId })
. catch (err => {
let errorMsg = err;
});
})
});