If you are trying to add it to a page that you have created within the Wix Members app then the link for the page would be like this for the My Account page from the Wix Members app as an example.
wixLocation.to("/account/my-account");
So with a button click to go to it would be like this:
export function myaccountbutton_onclick(event) {
wixLocation.to(`/account/my-account`);
}
Check the Wix Location API and make sure that you are using the to() function correctly.
Navigate to a local link
import wixLocation from 'wix-location';
// ...
wixLocation.to("/about-me");
The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality.
The APIs in wix-users can only be used once the page has loaded. Therefore, you must use them in code that is contained in or is called from theonReady()event handler or any element event handler.
Please post in a code block all the code that you have used for your page and screenshots so that we can see what you got setup.
If you are using a simple submit button through the Wix Editor which is connected to your dataset with it’s submit, then you can just use the settings to move the user on after saving, you don’t need code to do it. https://support.wix.com/en/article/adding-a-submit-button-to-your-form
I am not using any code at the moment on the page. The only code is below. but only as per your suggestion. It worked and redirected the page. But then i noticed that it redirected even when the submit fails, as in not all required fields are filled, and there is not submit. Also it didn’t wait for the file to upload if an upload is selected. myQuestions is a member page.
// For full API documentation, including code examples, visit https://wix.to/94BuAAs
import wixLocation from 'wix-location';
$w.onReady(function () {
//TODO: write your page related code here...
});
export function btnSubmit_click(event) {
//Add your code for this event here:
//wixLocation.to("/account/myQuestions")
}
I am not using any code at the moment on the page. The only code is below. but only as per your suggestion.
Well, with that first statement there, you should have been contacting Wix Support with your issue first of all as you are not using code and this Corvid Forum deals with code related issues only.
This no code used on your site notice should have also been mentioned in your original post too.
Therefore, the code used on the page will always make the user move onto the next page regardless of if the user fills in all the user input fields or doesn’t fill in any of them and won’t wait for any upload to finish etc.
As soon as the user clicks on the submit button it moves them onto the next page as that is all it has been told to do with that line of code.
You should take off that used code on your page and contact Wix Support and ask them why your page is not working as you are having issues with your site without the use of any code and only from using the Wix Editor setup itself. https://support.wix.com/en/article/contacting-wix-customer-care-for-support
As you have not used any code, then it is not a code related issue and is simply an issue with your setup within the Wix Members app and Wix Support should be able to help you with that.