Skip Navigation

[Resolved] Form not redirecting to page

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by lesleyA 2 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#2334275
Screen Shot 2022-04-05 at 12.00.45.png
Screen Shot 2022-04-05 at 11.59.24.png

Tell us what you are trying to do?
I have set up a series of forms to register CPT "Supplier"
The process is this:
User form > Post form to collect business details > Post form to collect a reference > Post form to collect second reference > Thank you page

My problem is that the "Post form to collect second reference" doesn't redirect to the thank you page after filling. Instead it shows itself again.

Things I have tried:
Switching off all non-Toolset plugins and reverting to theme Twenty-twenty-two – no difference

This morning though, I added this custom code to keep my user logged in while they completed the post forms:

add_action( 'cred_save_data', 'tssupp_cred_autologin', 10, 2 );
function tssupp_cred_autologin( $post_id, $form_data ){

if ( 2177 == $form_data['id'] ) { // Edit as required

if ( !empty( $_POST['user_login'] ) && !empty( $_POST['user_pass'] ) ) {

// get the user credentials from the $_POST object
$user = array(
'user_login' => $_POST['user_login'],
'user_password' => $_POST['user_pass'],
'remember' => true
);
$login = wp_signon( $user, false );

if ( is_wp_error($login) ) {
error_log( $login->get_error_message() );
}

}
}
}

Is it possible that I've got something wrong?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? This is the starting point for the flow (USER FORM): hidden link
This is the next POST form: hidden link
The next POST form: hidden link
And then this POST form: hidden link
Which should but doesn't go to this page: hidden link

#2334673

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?

I've enabled the private fields for your next response.

Thanks,
Shane

#2334687

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lesley,

Thank you for the credentials.

Not sure why this particular form isn't responding the way it should be, however can you remake the form? I tried to do a redirect with the Forms redirect hook but this doesn't react either which leads me to believe the issue is quite possibly the form itself.

Thanks,
Shane

#2335167

Clearly, there was something awry with one of my forms. Rebuilding the form (which was very quick to do, thanks to the Toolset form wizard) fixed the problem.

My issue is resolved now. Thank you!