You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a user facing form for saving addresses where they have to select their country, the client wants to force the users to choose one but start with an empty value.
When sending the form without country for validation I'm not getting an error on the country because it takes "US" by default, even though the user has not chosen one. Sending an empty string as countryCode does not replace the country in the address before it's validated.
I also tried to set an empty string to the config defaultCountryCode but I then get a 500 :
What happened?
Description
I've got a user facing form for saving addresses where they have to select their country, the client wants to force the users to choose one but start with an empty value.
When sending the form without country for validation I'm not getting an error on the country because it takes "US" by default, even though the user has not chosen one. Sending an empty string as countryCode does not replace the country in the address before it's validated.
I also tried to set an empty string to the config
defaultCountryCode
but I then get a 500 :Does this sound like a possible change ?
Steps to reproduce
defaultCountryCode
to an empty stringExpected behavior
I'm getting a validation error "The country field is required"
Craft CMS version
4.12.1
PHP version
8.2
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: