Skip Navigation

[Resolved] Using cred form with repeatable groups

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

Problem:

The issue here is that the user has their child form which gets some basic parent information from the URL. However after submitting the form and then being redirect to the same child form to add a new child post for the same parent the link to allow the user to click to the parent is broken again.

Solution:

The workaround to this is by using the [wpv-post-url] in combination with the [wpv-search-term] shortcode.

The way to get the url from the Parent id in the url can be seen below.

<a href="[wpv-post-url item='[wpv-search-term param='parent_planner-event_id']']">Back to [wpv-post-title item='[wpv-search-term param='parent_planner-event_id']']</a>

Where parent_planner-event_id is the url parameter.

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
- 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 6 replies, has 2 voices.

Last updated by mikeB-14 5 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1223067

I am trying to:
I have a cred form which is triggered a post to the cred from.
The form works well and stays on the form allowing be to create another record.
I have a back to previous link which takes me back the the main parent.

I if i do multiple creates in the same cred form , the back link does not take me back the parent post but just loops on the cred form.

[credform]
Back to [cred-post-parent get='title']
[cred_field field='form_messages' class='alert alert-warning']
<div class="form-group ">
<label>First Name</label>
[cred_field field='delegate-grp-first-name' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group ">
<label>Last Name</label>
[cred_field field='delegate-grp-last-name' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group ">
<label>Delegate Email</label>
[cred_field field='delegate-grp-email' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group ">
<label>Attended</label>
[cred_field field='delegate-grp-attended' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group col-sm-6 hidden ">
<label>Planner Event</label>
[cred_field field='@delegates-collection.parent' class='form-control' output='bootstrap' select_text='--- not set ---']
</div>
[cred_field field='form_submit' output='bootstrap' value='Submit' class='btn btn-primary btn-lg']
[/credform]

#1223179

Shane
Supporter

Languages: English (English )

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

Hi Mike,

Thank you for contacting our support forum.

This happens because of the redirect. Remember each time you submit the form its redirecting you to the page again to enter the new data.

So pressing the back button will lead you to the previous form that was filled out. In order to go back to the parent you will need to press the back button the same amount of times that you've been redirected.

Thanks,
Shane

#1223232

But can i get a button/link which will take me back to the parent content ?
Must be a way to do this.

Tony

#1223240

Shane
Supporter

Languages: English (English )

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

Hi Mike,

Its possible to write a hook at redirects you to the parent page, by getting the parent id from the post.

We can get the url of the parent using the ID of the parent and redirect the user to that url.

The issue is that this is going to happen after each time the user submits the form. It would be automatic.

Is the Parent ID in the URL of the form when entering the repeatable data ?

Please let me know.
Thanks,
Shane

#1223737

Ok when I loop the second time this is what is have as the URL

hidden link

The URL I start with is

hidden link

I then click on create new delegate this takes me to this URL

hidden link

and the second time I add a repeatable form record, get the URL as mentioned at the top.

Just a quick question is this support ticket hidden ?.

I hope this helps on how to get back to the parent record.

Tony

#1223955

Shane
Supporter

Languages: English (English )

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

Hi Mike,

Thanks the threads are actually public however your urls are hidden and only you and our support team can see the URL's in the thread. I can remove them if you like.

Try adding this.

Back to [wpv-post-title item='[wpv-search-term param='parent_planner-event_id']']

Please let me know if this helps.
Thanks,
Shane

#1224019

My issue is resolved now. Thank you!