Skip Navigation

[Gelöst] Default value for a generic select cred field

This support ticket is created vor 6 Jahre, 6 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by romanB-3 vor 6 Jahre, 6 Monate.

Assisted by: Minesh.

Author
Artikel
#570899

Hello,
I have this select cred field

      [cred_generic_field field='responsable-projet' type='select' class='' urlparam='']
      {
      "required":1,
      "validate_format":0,
      "default":[],
      "options":[json-users-list]
      }
      [/cred_generic_field]

populated with a json list of users.
In my "edit" cred form for the CPT, I need to pre-fill the select with the value stored in [types field='responsable-projet'][/types].
How can I do this ?
Thnak you.

#570920

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you try to use following code and assign the types shortcode to your default value:

[cred_generic_field field='responsable-projet' type='select' class='' urlparam='']
{
"required":1,
"validate_format":0,
"default":[[types field='responsable-projet'][/types]],
"options":[json-users-list]
}
[/cred_generic_field]

Does this help?

#570927

Hello and thank you,
I already tried this with no effect. I was thinking it was because the JS is executed after the the default is set. Is this possible ?
Thank you.

#570935

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Which JS you mean is executed after?

Could you please share problem URL?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.