Submit Button Redirect not working.

The Data base is getting updated, and the hooks are working but the redirect is not working.

I have line the button to a member page but it gets the error
“Wix code SDK error: undefined/myQuestions is an unsupported url”

However the url is “account/myQuestions” when i check it.

Site address is https://simfani.wixsite.com/rewise4

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");

Also, note that the user must be logged into your site first for them to be able to access this page.

If they are not logged in then they will not have the permissions to access that page.

Finally, make sure that you test anything with Wix Users API in a live published site and not just through the preview mode.
https://www.wix.com/corvid/reference/wix-users.html

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 the onReady() event handler or any element event handler.

I have tried it, and the submit button redirect before saving. also incase of a submit fail, as in all the fields are not filled, it still re-directs.

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

Going from your descriptions in your posts here, it seems that you have simply used the Wix Members app and added a new page to it and made up some questions on this page, which I assume are user inputs that the user has to answer.
https://support.wix.com/en/site-members/setting-up-a-members-area
https://support.wix.com/en/article/offering-exclusive-content-to-your-members

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.

If you want to make up your own dynamic pages for your members to use with your site, then have a look at this member profile tutorial to begin with.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

Ir to create a simple user input form without code as shown here.
https://support.wix.com/en/article/creating-a-form-with-user-input-elements
https://support.wix.com/en/article/working-with-user-input-validation-in-the-settings-panel
https://support.wix.com/en/article/troubleshooting-user-input-elements-issues