Phone Input
Hello all,
I have form that contains phone, mobile,city and country and I'm using ysfkaya/filament-phone-input plugin for phone field, now how to show the flag and country code based on selected country> is it possible?
Thank you.
5 Replies
what code did you try?
I think you are asking about how to update a field when another fields is changed, this is a general thing and here is an example from the docs:
https://filamentphp.com/docs/3.x/forms/advanced#generating-a-slug-from-a-title
see also the docs of the plugin you use if it has a different way to set that phone number field state
If you make the country field reactive and on initialCountry method of the phone you check if the country field is filled, then you set it as the value of the country
keep in mind that the plugin expects country codes as valid values
thank you all.