Options
* — Required option
Option | HTML attribute | Type | Description |
---|---|---|---|
country * | data-fv-phone-country | String | An ISO-3166 country code. It's dynamic option |
message | data-fv-phone-message | String | The error message. The dynamic message is supported |
When setting options via HTML attributes, remember to enable the validator by setting data-fv-phone="true".
The message and other options can be updated on the fly via the updateMessage() and updateOption() methods
Since the plugin doesn't support HTML 5 type="tel" attribute, you should use type="text" instead.
If you want to support custom formats of a phone number, you should use the transformer option. The modifying the value before validating example is good starting point.
The supported countries are:
You should look at the Validating international phone numbers example to see how to integrate the intl-tel-input plugin that supports most of phone numbers in the world
Example
Related validators
The following validators might be useful to you: