Skip Navigation

[Resolved] user single line field as placeholder in multiple lines field?

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 4 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1737769

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?

#1738395

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

#1738505

My issue is resolved now. Thank you!

#1738825

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!

#1741433

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