odolbeau / phone-number-bundle

Integrates libphonenumber into your Symfony application
MIT License
217 stars 43 forks source link

Validation with Country choice widget #86

Closed Hraph closed 3 years ago

Hraph commented 3 years ago

Hello,

How to use the number validation when the choice widget is used? I need to validate the number based on the user's country selection but the validator can't find the "country" field in PhoneNumberType, even if the "regionPath" option is specified. Thanks in advance

Nek- commented 3 years ago

Hello, I don't understand why you would validate a choice since it's supposed to be pre-defined. Maybe you should validate before in your process?

If you can't, it's still possible by combining it to "Collection" or maybe "All" validators of Symfony.

You should provide an example of what you are trying to do if you want help. Also please consider this issue section is dedicated to issues and not questions, you may get more help on StackOverflow.

Closing because it is a question not an actual issue.