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
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
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