sorry i used wrong wording in question (i meant to say default value text not placeholder text)
I am trying to figure out if it is possible to use user input of single line field as default value text in multiple lines field.
i have 3 user single line fields. On another page further in to the user form, i have a multiple lines field and i want to use the content from the previous single line fields and default value text in the new multiple lines field.
Is there a way to achieve this or a workaround?
Hello,
I assume we are talking about three custom user single line fields, which are created with Types plugin, and a Toolset user form for editing user with a multiple field.
You can get current logged-in user's field values with Types shortcode:
[types usermeta="my-field-1" user_current="true"][/types]
[types usermeta="my-field-2" user_current="true"][/types]
[types usermeta="my-field-3" user_current="true"][/types]
https://toolset.com/documentation/customizing-sites-using-php/functions/#textfield
Then use above shortcodes as default value of multiple field shortcode "value" attribute, for example:
[cred_field field="mobile" post="agent" value='[types usermeta="my-field-1" user_current="true"][/types] [types usermeta="my-field-2" user_current="true"][/types] [types usermeta="my-field-3" user_current="true"][/types]']
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
value. Optional. Preset value
My issue is resolved now. Thank you!
Thanks for your help - i notice after doing this, i cannot save new values in the multiple lines field. After submitting the multiple lines field, it automatically reverts back to the value specified from the single line fields - is it possible to make the multiple lines field now accept new values, despite showing the default text?
For example, instead of using the "value=" is there an option to use something like "default-value="?
After doing some research, we discovered that we can use default_value and it works thank you!
I assume we are talking a Toolset form for editing post/user.
If it is, there isn't such kind of built-in feature within Toolset Forms plugin, see the document I mentioned above:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
There isn't such kind of option "default_value", so you are at your risk to use "default_value" attribute, this attribute might not work in feature version of Toolset plugins.
In my opinion, you can use wpv-conditional shortcode to check the "multiple lines field" field value, then display different [cred_field] shortcodes (with value attribute or without value attribute),
more help:
hidden link