Problem: I would like to know how to pass values into a CRED form on another page, or on the current page.
Solution: Use the "urlparam" attribute on any CRED field to set the value of that field using a URL parameter:
[cred_field field='contact-car' post='contact-form' urlparam='contactcarparam' class='form-control' output='bootstrap']
In your link to the other page, add the url parameter after the listing ID parameter the end of the URL:
<a class="btn btn-lg btn-primary single-contact-button" href="[wpv-bloginfo show='url']/contact/?listing-id=[wpv-post-id]&contactcarparam=[wpv-post-field name='wpcf-ownersvehicle_id']">Contact Us</a>
If you want to set the value of a field on the current page, use the [wpv-post-field] shortcode to access the raw field value:
[cred_field field='contact-car' post='contact-form' class='form-control' value='[wpv-post-field name='wpcf-ownersvehicle_id' id='$current_page']' output='bootstrap']
Relevant Documentation:
https://toolset.com/documentation/user-guides/cred-shortcodes/
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-field
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 4 replies, has 2 voices.
Last updated by 7 years, 3 months ago.
Assisted by: Christian Cox.