Not redirecting to thank you page on form submission
I have created a multistep form in HubSpot using HubSpot forms. I want to redirect to a thank you page(which was build using HubSpot) on second step form submit. I gave the HubSpot thank you template name on 'redirect to another page' option available in HubSpot form. But it is not redirecting.
I have altered the form submission code a bit to make multistep functionality ( using this code : if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') ) . Is it bcoz of this the issue is happening? If I do redirect for the first step it works perfectly. I am having a problem when I go to the second step and redirect.
What are the possible solutions for this?