Problem:
How to dynamically generate the title of a post submitted with a Toolset Form using field values from the form?
Solution:
There are two possible solutions for what you want to do.
In the first you use JavaScript to add on change event listeners to the inputs for field1 and field2 and you update the post_title with their contents. In that way the post title input is populated when the form submits.
The second method is to omit the post_title field from the form altogether so that no title is submitted, and then use the Forms API (specifically, the cred_save_data hook: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data) to intercept the submitted and update what would be an auto-generated title using PHP based upon your custom fields.
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 7 months ago.
Assisted by: Nigel.