Hello,
I have created a User form and would like to redirect the form after completion to a specific Thanks you page.
In this page, I would like to display some of the Form info (firstname, lastname ...).
How can I get those info?
Regards
Pat
Sounds bad. I have seen this feature in some website and wonder how this is feasible?
On an other hand, I could use the message in the same page, but the issue there is that I have different messages on this page depending on the user is logged-in or if the user has a certain role. So, in this case, the user is not logged-in and so, the message for non logged-in user is displayed. Is there a way to manage between a non logegd-in user and a user that have filled the form?
Understood. I will change to add the non logged text inside the form. Doing this, I will be able to display a message after the form fill.
Now, what do I need to display the form fields inside this message. Can I use them using the standard Views fields (or do I need to use %%USER_FIRSTNAME%% for example)?
Regards
Pat
Are you referring to if a user who is logged in fills out the form ?
If such is the case it won't display what the user filled out in the form, it will display the information of the current user.
However if you setup the notifications for your form then you will be able to send the data that was entered onto the form into this.
Also I thought of a way that you can have your thank you page with the form data. Using the redirect hook below we can pass the information from the form in the URL and then retrieve it on the thank you page.
add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)
{
if ($form_data['id']==12){
$first = $_POST['first_name'];
return '<em><u>hidden link</u></em>'.$first.'';
}
return $url;
}
As you can see im getting the first_name from the form and appending it to the redirect URL of my form. Now to retrieve the first name on the thank you page, you will need to add the following shortcode to the page that you're redirecting to.
[wpv-search-term param='name']
This will pull the value from the URL parameter called name.
No, I'm just speaking of the success message that is displayed after the form has been filled. We have the ability with Form to define what to do after the submission (another page, cart, message ...). I just want to display the success message with some of the Form field inside.
For info, the Form creates new user, so the user is not logged when he is submitting the form (in fact, I have a conditional output that change the content of this page depending of the user logged-in or not. If not logged, then, we display the Form and when the form is submitted, I want to display the success message using some fields of the form (firstname, lastname).
Regards
Pat
I just want to display the success message with some of the Form field inside.
In that case then no this won't be possible to do, you won't be able to display data from the form in the success message that is being displayed after you submit the form.