Skip Navigation

[Resolved] change the select_text to generic select field

This support ticket is created 2 years, 11 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
- 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 1 reply, has 2 voices.

Last updated by Minesh 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2308931

Dear Sir/Madam,

Refer to a cred_field, there is an argument select_text to display the text if no option be selected from the select tag

[cred_field field='@member-application.parent' class='form-control' output='bootstrap' select_text='' required='false' urlparam='mid'  readonly='true']

How about the cred_generic_field

	      [cred_generic_field type='textfield' field='wpcf-app-member-number' readonly='true'  urlparam='mno']
          {
          "required":0,
          "default":"[types field='member-number'][/types]",
          "persist":1      
          }
        [/cred_generic_field]

I try adding the select_text argument in shortcode or its array but not work

        [cred_generic_field type='select' field='wpcf-app-proposed-tablet' select_text='--- Please select option ---']
        {
          "required":1,
          "options":[ [get_tablet] ],
          "persist":1,
          "select_text": "--- Please select option ---"
        }

The result is still showing "--- not set ---"

#2309937

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

To set default option for your generic select dropdown, you will have to add the attribute "default":[""]:

Please check the following example - please note that the default option should be coming from your shortcode [get_tablet]:

[cred_generic_field field="test-select" type="select" class="" urlparam=""]
{
"required":1,
"validate_format":0,
"persist":0,
"default":[""],
"options":[
{"value":"","label":"Please Select"},
{"value":"a","label":"a"},
{"value":"b","label":"b"}
]
}
[/cred_generic_field]