Skip Navigation

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

This support ticket is created vor 7 Jahren, 2 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von romanB-3 vor 7 Jahren, 2 Monaten.

Assistiert von: 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

Sprachen: Englisch (English )

Zeitzone: 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

Sprachen: Englisch (English )

Zeitzone: 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.