Hi and sorry for the long gap between responses.
Yes, my code was just an example but it shouldn’t be far from what it should actually look like.
When I paste the code on my page, it says that “memberID is undefined”.
You should use WixUsers API to get the id of the current user (the one, that is filling the form) and then update appropriate row in Members collection. It’s similar to the problem described in this thread:
Capturing current user id - Ask a question - Wix Studio Community forum
- Also, I’m not sure where should I write the key of the item in the collection that has the membership type.
Can you elaborate? Though, if I understood the question correctly, then the piece of code I pasted does exactly that - grabs id of selected membership and assigns it to appropriate member (aka current user) in Members collection.