CRED is a WordPress plugin that lets you easily build front-end forms for creating and editing content and users.
CRED User Guides include detailed documentation on creating forms, including related fields that belong to the content or the users, validating the input and displaying the forms with custom HTML styling.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 1,516 through 1,530 (of 1,588 total)
Add more options to custom select field with Toolset Forms.
Solution:
There isn't such kind of built-in feature within Toolset Forms plugin, the options of custom select field can be setup only in WP admin side, you can not change them in front-end.
In your case, you can try to replace it with a custom taxonomy "city", so your user can add more terms in front-end with Toolset Forms.
Problem: I want to create a select field with multiple options, and set the value of another custom field depending on the value selected in the select field.
Solution: You can use custom code with the cred_save_data API to get the selected value from one field and save a corresponding value into a Types custom field programmatically. You can find the field selections in the $_POST superglobal. Types fields have a key of "wpcf-" plus the field slug. Generic fields have a key identical to the field slug. So if the select field is a Types field with the slug "select-field", then you would be able to get the selected value like so:
$_POST['wpcf-select-field']
If it is a generic field with the slug "select-field", then you would be able to get the selected value like so:
$_POST['select-field']
Use the WP function update_post_meta to set a Types field value programmatically. A full example:
You would change 123 to be the numeric ID of the Form, wpcf-select-field to be the slug of the select field (with the wpcf- prefix if this is a Types field), and wpcf-points-field to be the slug of the points field (with the wpcf- prefix if this is a Types field). That would save the selected value of the select field into the points field when the Form is submitted.