Skip Navigation

[Resolved] How to submit the form and display submitted form details on form submit redirect and add edit link on it

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to submit the form and display submitted form details on form submit redirect and add edit link on it

Solution:
You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/create-a-form-that-only-the-user-can-access-and-edit/#post-1077373

Relevant Documentation:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect
=> https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/#inserting-editing-links

This support ticket is created 5 years, 9 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by troyR-2 5 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#1074792

I would like to create a form (like the subscriber profile) that only a specific subscriber can fill-out and edit. For example, the subscriber wants to fill out Forms A and submit it. He can later make changes to Form A if he wants. He should be able to find the display and edit versions of Form A by clicking a link called "Form A" and/or "Edit Form A," respectively."

Is there any documentation that you are following? I cannot find the documentation for this.

Is there a similar example that we can see?

What is the link to your site? hidden link

#1074863

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you can control the user profile based on role not for a specific user. So, if a user have specific role - you can allow him to create the profile or edit the profile.

You can either have CPT that holds the user profile fields:
=> https://toolset.com/documentation/user-guides/creating-cred-forms/

Edit Post form:
=> https://toolset.com/documentation/user-guides/cred-training-course/part-5-building-forms-content-editing/

OR

Create a Toolset User Form:
=> https://toolset.com/documentation/user-guides/cred-user-forms/

Edit User form:
=> https://toolset.com/documentation/user-guides/cred-training-course/part-8-building-forms-for-editing-user-profile/

And based on the current role assigned to user you can show/hide the form for loggedin user.

#1077335

Applying the CRUD approach, I am still trying to create steps where a subscriber can easily create a form submission, read what they submitted on a details page, and later go back and edit it. The following is a 2-minute video explaining what I already did and what I still need to build so there is no confusion:

Video: hidden link

Please note that I can do this myself with regular coding. However, I am trying to see if Toolset can do this for me. I want to hand projects like this off to a team member that may not know how to code well.

#1077373

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - what you need is basically a details page that shows the all the values submitted and at top of the details page you need Edit form link.

So, you should create a details page that displays all the information submitted to form and with form settings you can chose the page from "What to show after submitting the form: " setting and select "Go to a Page" and select the page where all information is displayed.

You need to pass the post ID on details page to identify for which post ID the information show be displayed, you should use the Form hook cred_success_redirect

add_filter('cred_success_redirect', 'custom_redirect',10,3);
function custom_redirect($url, $post_id, $form_data)\{
    if ($form_data['id']==99999){
        return '<em><u>hidden link</u></em>'.$post_id;
   }
    return $url;
}

Where:
- Replace 99999 with your original form ID

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

Once you do this:
-- create a view and select your post type and add a Post ID filter filter by URL param.
=> https://toolset.com/documentation/user-guides/filtering-views-query-by-post-id/
-- Now, add all your information, fields you want to dispaly which is submitted to form.
=> https://toolset.com/documentation/user-guides/view-layouts-101/
-- Save the view once you added all your fields you want to display and add this view to the details page you created at first.

To add Edit link - you need to create another form Edit form and another page that holds the edit form:
=> https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/#inserting-editing-links - Add edit link o
=> https://toolset.com/documentation/user-guides/displaying-cred-editing-forms/
=> https://toolset.com/documentation/user-guides/creating-cred-forms/#insert-form-to-page

#1077381

This is good information that unfortunately does not answer the question. I specifically said that I already know how to code. The end game was to pass "projects like this off to team members that MAY NOT know how to code well." I needed to know if I could do this.

So, this was more of a "yes" or "no" questions where I believe the answer is "no."

However, I will use the information you gave me above to correct a few things on my already existing details page and to design an edit page. However, Toolset is still too roundabout with solutions if I have to create 3 pages and a post type. There are still too many confusing steps and moving parts for a process that may not exist in three years.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.