Skip Navigation

[Resolved] Cred Form: add form-parameter

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 – 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 11 months ago.

Assisted by: Waqar.

Author
Posts
#2680433

Hi,

i'm have a post form with some select options. Depending on the form shortcode i want to edit the options dynamically.
For example: if i use [cred_form form="1" usetermmeta="A"] i want to fill the options with some term metas. And others Options in [cred_form form="1" usetermmeta="B"]
How can i do that?

Best regards

#2680579

Hi,

The 'cred_form' shortcode doesn't support additional shortcode attributes.
( ref: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_form )

To make this dynamic, you can alternatively, pass on the target values through the URL parameter, e.g.:
{yourwebsite.com}/page-with-form/?target-value=A

The value from a URL parameter like 'target-value' can be used as the individual field's default value, through the 'urlparam' attribute:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field

You can also use the 'wpv-search-term' shortcode in the form to get this URL parameter value, independently:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-search-term )


[wpv-search-term param='target-value']

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

regards,
Waqar

#2681413

Mh, too bad.
The page is linked default in the navigation without any parameter.

I found a solution by my own: the form ist addet via [cred_form form="x"]. In my taxonomie i have a option to ask for the page, where the form is inckuded. So i have the post_id in my form, look for the terms in the taxonomy associated with this id.
Its not elegant editorially but the best for now.

Best regards