I've built a country selector following
this tutorial
. Works fine, except the 'Default' option seems to have no effect.
Illustrative
example page
.
Full backend CB config details at the end, but in brief:
CB > Fields > select_my_field > Global tab > Default: GB
I've checked for
- leading or trailing spaces around 'GB' in my CB config
- leading or trailing spaces in the option elements in the DOM
- It uses a simple 2-column country database pulled off the web. So, to eliminate that, I also switched temporarily to the one linked from the tutorial (made no difference).
__________________
This seems such a simple thing I can't believe it might be a bug. But I've also spent far too long trying to work out whether I've done something wrong.
My config:
Joomla 5.4.7
CB 2.11.0+build.2026.03.09.15.07.44.b34f2745a (latest as at time of posting)
Potentially relevant non-default CB settings
- CB > Field Management > cb_country >
- Global tab >
- Type: Query Drop Down (single select)
- Label: --- select country --- (I also tried empty string)
- Show on Profile: No
- Default Registration Value: GB (I also tried other country codes)
- Size 1
- Parameters tab
- Query tab >
- SELECT `iso`, `country` FROM `#__country_info` ORDER BY `country`
- (I tried switching the order to country, iso and various other combinations)
- Options tab >
- Value Column: iso
- Label Column: country