Skip Navigation

[Resolved] Select's default is not what was set for default value

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display types select field using CRED with default selected value

Solution:
To display types select field using CRED with the default value, you need to make sure you have already set default option from custom fields group.

In this case, you can find proposed solution with the following reply:
https://toolset.com/forums/topic/selects-default-is-not-what-was-set-for-default-value/#post-401600

Relevant Documentation:

This support ticket is created 7 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 8 replies, has 2 voices.

Last updated by gaborG 7 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#401009

I added a list of countries to my user registration form, and I set USA for default since most of my clients will be from there. However, the form keeps displaying the first item, Afghanistan, as default.
How can I set it right?

#401067

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Could you please share screenshot of your drop-down so that I can check how you configure your dropdown.

Also, problem url where I can see your dropdown?

#401082
Select displayed.jpg
Select settings.jpg

You can see how it's set up on the attached image.
I made the form temporarily accessible here: hidden link

#401131

Minesh
Supporter

Languages: English (English )

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

Could you please try to resolve your issue by following the instructions given with the following link:
https://toolset.com/errata/cred-not-show-the-default-value-of-types-select-field/

#401311

I changed the file but the problem is still there.

When I disable default, it says "--- Not Set ---" but when I pick a default value, regardless what I choose, it displays the first item.
The same problem happens with both Selects in that form - country and US state.

#401391

I just noticed that it is actually working properly on the WordPress Admin page if I add a new user there, it only doesn't work on the front-end. Maybe this info helps in figuring it out.

#401440

Minesh
Supporter

Languages: English (English )

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

Could you please send me steps to reproduce your issue with 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.

#401600

Minesh
Supporter

Languages: English (English )

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

I've changed the CRED country field to:

[cred_field field='country' post='user' value='United States of America' urlparam='']

Now, I can see 'United States of America' is selected.

You can assign the selected value to "value" attribute to display selected option.

I hope this solution will help you to resolve your issue.

#401635

OK, it seems to be fine this way. Thanks.

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