bissolli / nova-phone-field Goto Github PK
View Code? Open in Web Editor NEWNova Phone Number field with a dynamic mask based on the country code inserted by the user.
License: MIT License
Nova Phone Number field with a dynamic mask based on the country code inserted by the user.
License: MIT License
For example: (+XX) YYY-ZZ-WW
This is the number format.
In my country country and most of the other countries phone codes end with "0".
+70 707 70 70 or +90 909 90 90
But when people calling each other without "+9"
0707 70 70 / 0909 90 90
So my customers cant figure out default country code section and writing one more 0.
writing "+90 090 09 09" instead of "+90 909 90 90".
I hope i could express myself. I can override your code but i can use your package all the time i sure :) And other people may need to this. We need to block 0 for 4. string.
+90 X.... This X can't be 0. Can we do this? Or should i just override?
Compatibility with Nova 4.0
Hello. How to validate a value if the value in the field is not specified?
I made a field
->onlyCountries('RU')
Mask : +7 (###) ###-##-##
and added a validation rule:
->rules(['nullable', 'regex:/^(\+7) \(\d{3}\) \d{3}-\d{2}-\d{2}$/'])
If I erase the value from the field and try to save the form, then the value +7 (___) ___-__-__
inevitably comes in the request
It seems to me that you should make it so that the mask is activated only by input / focus ...
Hey!
Thank you for amazing work.
Kindly always force the direction to be ltr as styling the input because when the page's direction is rtl for other languages the input mask does not show as expected.
and phone numbers are handled left to right for all languages as far as i know
Thanks!
if phone field is null then this error in console
TypeError: Cannot read property 'replace' of null
at a.unmaskedValue (nova-phone-field:1)
at Ne.I3G/.Ne.get (vendor.js?id=b30263b2f9d68433c3ce:1)
at Ne.I3G/.Ne.evaluate (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.unmaskedValue (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.render (nova-phone-field:1)
at a.I3G/.t._render (vendor.js?id=b30263b2f9d68433c3ce:1)
at a.n (vendor.js?id=b30263b2f9d68433c3ce:1)
at Ne.I3G/.Ne.get (vendor.js?id=b30263b2f9d68433c3ce:1)
at new Ne (vendor.js?id=b30263b2f9d68433c3ce:1)
at vendor.js?id=b30263b2f9d68433c3ce:1
Hi, when I try to set a different field name is not working. It takes the label as the field name that should be send to the server.
PhoneNumber::make(__('Phone'), 'content')
The example above send a field with the name phone
instead of content
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.