Skip Navigation

[Resolved] Parent/child form for anonymous users

This support ticket is created 7 years, 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 14 replies, has 2 voices.

Last updated by shomariM 7 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#443897

This is a follow up to an existing post. It is closed so I can't respond.
https://toolset.com/forums/topic/parentchild-form-for-anonymous-users/

I understand that forms cannot be nested however I am trying to see if its possible to have my page similar to the built in WordPress form. After submitting the parent form, I would like a list of the child items below the parent form (after initial save nothing will be listed). User can then choose to add a new child item, edit an item, or exit.

#443903

After every child is added I would like the user to go back to the parent where the view is updated and they can add another child.

#444101

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would suggest that you should redirect to a new page after submit parent form and on that page you should display the child entries belongs to that form.

To redirect the CRED form after the submit you can use CRED hook: "cred_success_redirect"
More info:
=> https://toolset.com/documentation/user-guides/cred-api/#csr

#444114

Thank you. I ended up figuring out out and doing just that.
- User fills out parent form
- On submit, show parent post that includes a view listing child post and a link to add a new child post
- On submit of child post, redirect back to the parent view page using cred_success_redirect filter in functions.php. The recently added child is now listed.

I am now stuck at the last piece. How can I allow anonymous users to edit the parent that they just added? This is similar to a multipage form. I know this plugin does not support multipage forms but I saw a post where the developer used a separate edit form for the additional fields. Here is the scenario:
- There are three additional fields that users need to fill out after adding all child posts.
- I added these as 3 fields to the parent post fields list but I do not show them on the initial add new parent page. The three fields are in a new form that is used for editing.
- On the content template I added a new button using cred_link_form with the title "Complete Report" that takes users to the edit form that shows the additional fields. The issue it seems is that anonymous users cannot edit posts.
- Under Access Control -> Post Types, I cannot give Guests "Edit Own" permission. The only permission allowed to change for Guest is "Read". If I switch to the Cred Forms tab, I am able to select guests permission under "Edit Own Custom Post with CRED Form "Full Report Complete"" but this does not work. Only logged in users can see the edit page with the last 3 questions.

Right now it seems like my only option is to put the last 3 questions as another child post. Is this the only solution?

#444117

Minesh
Supporter

Languages: English (English )

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

If you like to create multi-step form you can follow the solution I've offered you on this post reply:
=> https://toolset.com/forums/topic/i-have-problem-with-a-slider-from-multiple-image-types-field/#post-405416

Where:
you need to make sure that first form (1st step) should be the Create form and other forms (steps - step 2, step 3, step nnn) should be the Edit form.

Does this help?

#444186

Thank you! This is a great help. One issue, shortcode within a shortcode isn't working.

[cred_form form='368' form_name='RETIRO INDIVIDUAL PREMIUM PARTE DOS' post='[get_url_post_id]']

get_url_post_id is never called. If I put the shortcode by itself it is called so I am sure it works.

#444194

Minesh
Supporter

Languages: English (English )

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

you are free to make amendments as required to build your solution and if you have workaround you can use it.

#444203

Do you have any suggestions? How did you get the shortcode to work within the shortcode?

#444204

Minesh
Supporter

Languages: English (English )

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

Could you please explain me each steps you are using and CRED form?

1)
could you please share problem URL?

2)
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#444285

Minesh
Supporter

Languages: English (English )

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

As shortcode inside shortcode not working:

I've added following shortcode to your functions.php file - to dispaly the CRED form:

function display_cred_form() {
	return cred_form(13038,$_GET['cred-post-id']);
}
add_shortcode( 'get_url_post_id', 'display_cred_form',10,3);

Now you can see the form:
=> hidden link

I hope this solution will help you to resolve your issue.

#444289

Perfect... Thanks. Last question. How do I get the edit form to appear for anonymous users? It works when I'm logged in but not when I'm a guest.

#444310

Minesh
Supporter

Languages: English (English )

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

You need to give access rights to guest user from Access.

You can navigate to:
=> Toolset => Access Control => CRED Forms.

But I see some weired behaviour and it's not working even though the permissions set for guest to view the form

I think there must be some conflict with third party plugin or theme:
1)
Could you please try to resolve your issue by deactivating all third-party plugins as well as the default theme to check for any possible conflicts with any of the plugins or themes?

2)
Could you please try to check with another install with Default theme + Toolset plugins and try to setup same functionality and check if it works with another test install?

#444311

Ok will do. Thank you.

#444314

Minesh
Supporter

Languages: English (English )

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

As your original issue is resolved, If you find any issue, please kindly report it by creating a ticket as that will be the different issue. This will help other users searching on the forum.

Thank you!!

#444354

There is a bug in the cred software with version 1.8.1. I had a copy of 1.8 and once I installed that version it worked. I came across this post that pointed out the problem. https://toolset.com/forums/topic/cred_form-not-displaying-for-guests/

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