Redirect user after Signup to another Page

Hi,

How do i redirect users who signup using the Members Form from Wix to one of my Member pages? Currently they stay at the same page where they have logged in.

2 Likes

https://www.wix.com/corvid/reference/wix-location.html#to

Although you can’t use it if you use Wix own forms for login and signup, so you would be better doing your own custom login and signup lightboxes and add the code directly to them for it.

Hi everyone!

After a very long search, I came up with a solution that works for me.

First of all, I use Wix Custom Form Signup (with login bar)

This is how it works for me:

  1. Go to your Signup page and select the Wix form from the lightbox.

  2. In the properties panel add Event Handlers onWixFormSubmit() and onWixFormSumitted() (click on the plus icon - this will add some code to your page)

  3. Add this code to the page, before whatever code you want to add:

import wixLocation from ‘wix-location’ ;

export function registrationForm1_wixFormSubmit() {
[wixLocation.to(](wixLocation.to(“/blog”);
}) [“/blog”](wixLocation.to(“/blog”);
}) [);](wixLocation.to(“/blog”);
})
[}](wixLocation.to(“/blog”);
})

export function registrationForm1_wixFormSubmitted() {
[wixLocation.to(](wixLocation.to(“/blog”);
}) [“/blog”](wixLocation.to(“/blog”);
}) [);](wixLocation.to(“/blog”);
})
[}](wixLocation.to(“/blog”);
})

First line is used to enable the wixLocation.to() function.
The second one is the code generated once you add the onWixFormSubmit Event Handler. Within it I added the wixLocation.to() function to say where to redirect. In my case, the /blog page.
The third one does the same, but for Submitted event handler.

I don’t why I had to use both Submit and Submitted events…but it works.
First I tried only Submitted, and it worked but when I checked my Contacts list, I saw that only the name and email fields were added. The rest of the custom fields were blank.
Adding Submit event handler fixed that.

Hope this solution works for you too!

The solution worked like a charm; I used the below code for a Wix light box sign up… with some additional fields.

import wixLocation from ‘wix-location’ ;

export function registrationForm1_wixFormSubmit() {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
[wixLocation.to(](wixLocation.to(“/your) [”/](wixLocation.to(“/your) URL” );
}

export function registrationForm1_wixFormSubmitted() {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
wixLocation.to( “/URL” );
}

Tried adding the Formsubmit an Formsubmitted option on my registration form but it didn’t work. Used the exact same code safe for the /URL that I replaced with my TY page. Is there an incidence of this code vs the onReady function that is already there? I tried to place the code after this function, and tried wrapping it inside - no luck.

$w.onReady(function () {
// Write your JavaScript here

// To select an element by ID use: $w("#elementID") 

// Click "Preview" to run your code 

});

Hi David Desrosiers,
It would be helpful to suggest if you put the exact code of yours here. The code you have put has no logical body in it.

Also in the example mentioned previously by @brightbox83 and @anghel2001
exportfunction registrationForm1_wixFormSubmitted()
and
exportfunction registrationForm1_wixFormSubmitted()
are the functions registered to trigger upon events.
That is very important here.