cedvdb/phone_form_field

[Question] how to fill field when editing phone number ?

Closed this issue · 3 comments

I have got the phone number in this format $countryCode.' '.$nsn: +226 70 20 30 40
I want to set an initial value for the field with this number for editing. but the field needs a PhoneNumber() as initialValue.
what I've done, I put in phoneNumber() the isoCode, and the nsn but it not working.
the field is still empty.

how can I format the international phone number to be able to set as initialValue in phone the form field?

Try PhoneNumber.parse("+226 70 20 30 40")

cedvdb commented

@saifonglee

Indeed, try what was suggested above if you haven't already. I'm going to close this issue for now, feel free to comment back if you are hitting more issues.

Thank you @sumitsharansatsangi.
It's now working fine.