I am trying to find out to let the users to add and edit database. I have created a form to add information into database, but not i have difficult to set up a page to allow user to edit the data they hv input before.
Below is the video shows, even when i just change rhe dataset setting permission as Read & Write. The form doesnt allow me to input. NO IDEA WHAT IS HAPPENING.
can someone help plz
Hi,
Have you check the permission of your database?
If you want to let your member can update data, you need to set the value of ‘who can update content from this collection’ to Site member author.
Now the problem is when i set the permission as “Read & Write” the form is froozen, i cannot tpye anything.
When i change back to Write, it works fine. I don’t know what is wrong.
and also i have no idea what i can do when i want the member can update the content who input before, simple change the permission as “the value of ‘who can update content from this collection’ to Site member author” doesn’t create an interface to show the row of data and update the row of data
Hey Ohad,
I am also having similar issue in my database. I reported it on starting of last month but haven’t got any proper solution for this issue till now. I am posting a video of the issue and you can see my forum post about this issue here . Please help me to solve this issue asap.
Is there a piece of code that we need to be integrating into the dynamic page to make it work? Really not sure what is going on here. I read through the support page and it is unfortunately not very helpful in addressing the issue.
So I’ve been doing a bit of troubleshooting and I’m assuming that you are using a second database which is different from your member database. I’ve found when I tie the form to the same database where my member’s login data goes, then I’m able to use the Read and Write function again.
The Question; does this have to be the way that the form and database is set up to allow read and write, or is there a way to link the the member database with the additional form specific database?
It took me about a week to think through it, but I finally figured it out (I’ve only been programming for like three weeks).
In order to get the read and write to work you need to add one more line of code to the member login code which inserts the user name and ID into the database for members. The extra line inserts the user name and ID into any additional database that you would like to activate for members only. This will then allow the Read and Write function again.
Wow, you have no idea what kind of milestone that was, lol.
Thanks @givemeawhisky . However, Dynamic page datasets do not have the Write-only mode. They only have READ_WRITE mode. Also, The dynamic page cannot display the item before it is created. Hence, when I choose the dataset as Read & Write mode, users are not able to add new content to their collection.
So what would be a good way to allow users to submit data for the first time. And also allow them to update thereafter?
@rishalsharma
As I said in the previous reply, just use the members profile tutorial as a starting point and design your dynamic page from there, with the first page being the read only page for the user to have their info displayed, with the second dynamic page being hte update page where they can change or add anything and then save it and return back to their main page which will then show the changes etc. https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area
I have used that same tutorial as a starting point too and capture the first and last name of the user on my custom signup lightbox too. Obviously, if you make your own custom lightbox for signup, you can add whatever user inputs you want onto your lightbox.
This works perfectly and closes after registering details before moving user to signup status page, then both names will be saved in Contacts and once site member is manually approved the member details will be added to ‘members’ database.
Then when the user goes to their own page, they will see their own first and last name and email shown, with the option to add more input through the user inputs on the update page too.
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#registerButton").onClick( (event) => {
let email = $w("#email").value;
let password = $w("#password").value;
let first = $w("#firstName").value;
let last = $w("#lastName").value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
}
} )
.then( (result) => {
let resultStatus = result.status;
wixWindow.lightbox.close();
wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
} );
} );
});
@givemeawhisky Firstly, thank you for taking the time to respond. A quick disclaimer: I know that, in principle, it does not matter what kind of page is being created… but just to be clear, I’m asking clients/members to input completely different kind of data (not profile data). Ex. post signup as members, I’m creating a page for clients to input their family details (first name, last name etc). It’s not mandatory but should they choose to input, I’ve created a page for them. I’m not sure if this is going to matter… but wanted to put it out there.
Now,
Do you think I’d still need to add a similar code after creating 2 dynamic pages?
At the moment,
As per this tutorial, I’ve created 2 dynamic pages with similar design. One for reading the info and the other for writing/updating the info. However, at this stage (without any code), its the same issue there too. Since there is no data to begin with… i.e. user is yet to submit data for the first time, the first page button does not work (i.e. it does not take me to the 2nd dynamic page for update).
However, if I do add a record of data from backend (directly), everything works fine.
Its baffling why such a simple task of creating a page to accept user data for the first time and then display it for future updates is such a complex task