Skip Navigation

[Resolved] Popup on redirect page following form submission

This support ticket is created 5 years, 4 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1318445

Hi,

Just curious: I am trying to "guide" my website visitors through a process of first creating a user, and then create a few different post types.

After user form submission, I am redirecting them to a post form submission page. I would like to add a little "popup" saying something like: "yay, your user is created! Now, time to add a post!" - but I would only want this to be shown for the people redirected from the user form page, as those already logged in will also see the page.

Got any ideas on how I might do this without creating multiple pages of form submission?

#1318589

Hi, there's nothing exactly like that built-in to Toolset, but you could probably accomplish it with a bit of custom PHP and JavaScript. You could use the Forms redirection API to add a URL parameter to the page URL when the User is redirected to the post Form. The URL would look something like https://yoursite.com/page-with-post-form/?msg=1

Then on the page with the Form, you could add some custom JavaScript code to trigger a modal or popup based on the value of that URL parameter. If the User doesn't come to the page from the custom redirect, the URL parameter will not exist.

We have more information about the Forms redirection API here: https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
Here's an example adding a URL param to the redirect URL: https://toolset.com/forums/topic/url-parameter-value-is-not-set-for-the-field-inside-a-cred-form/#post-655270

How to detect URL params with JavaScript: https://davidwalsh.name/query-string-javascript

How you trigger a modal depends on the type of modal system you decide to implement, so I can't predict the code you'll need here.