Skip Navigation

[Resolved] Split: Automatically selecting the related post in the form

This support ticket is created 2 years, 3 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#2438035

Good morning (in portland oregon anyway 🙂 Waqar

I have solved my problem! The iphone was taking the images at a resolution that made the file size too big. I changed a few settings and now all is good. I do have another question tho.

I have a one (pod) to many (carts) relationship. When making a new cart post, in the form there is a dropdown to select the pod that the cart belongs to. The only way to arrive at the make a new cart page is from a button on the pod that the cart will belong to, so I already know what pod to assign the cart to. Is there a way to automatically assign this without needing a dropdown?

to reproduce:

go to cartpodfinder.com

click a marker on the map, then click the link that pops up
click make a new pod button
login with donna tello pass blahblah
the pod-cart dropdown is in form.

Thanks!
Bryon

#2438039

Hi Bryon,

To automatically select the "Pod" in the form's relationship field, you can follow these steps:

1. In the form's relationship field's setting, you'll see the field "Set default value from an URL parameter".

You can add a URL parameter like "rel-pod" in that field so that the field automatically gets the value from this URL parameter.
( screenshot: hidden link )

Note: If you've enabled the 'Expert mode' in the form, you'll include the URL parameter through the 'urlparam' attribute.
( ref: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field )

For example:


[cred_field field='@shop-book.parent' class='form-control' output='bootstrap' select_text='--- not set ---' required='false' urlparam='rel-pod']

2. Next, you'll update your "Add to cart" link, so that it includes the target "Pod" post's ID in the URL parameter 'rel-pod', so that the form knows, which pod to automatically select.

You can create a link like this in the "Fields and Text" block, using the following HTML code and shortcodes:


<a href="[wpv-post-url item='429']?rel-pod=[wpv-post-id]">Add a cart</a>

Note: The 429 is the ID of your website's 'Make a cart' page and [wpv-post-id] shortcode will add the current "Pod" post's ID in the link.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar