Skip to content

Commit

Permalink
readme tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Dec 1, 2024
1 parent cfd507c commit 5823f6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,14 @@ if (error === intlTelInput.utils.validationError.TOO_SHORT) {
```

**isValidNumber**
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof as while countries around the world regularly update their number rules, they very rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Respects the `validationNumberType` option (which is set to "MOBILE" by default). Requires the [utils script to be loaded](#loading-the-utilities-script).
Check if the current number is valid based on its length - [see example](https://intl-tel-input.com/examples/validation-practical.html), which should be sufficient for most use cases. See `isValidNumberPrecise` (DANGEROUS) for more precise validation, but the advantage of `isValidNumber` is that it is much more future-proof as while countries around the world regularly update their number rules, they rarely change their number lengths. If this method returns `false`, you can use `getValidationError` to get more information. Respects the `validationNumberType` option (which is set to "MOBILE" by default). Requires the [utils script to be loaded](#loading-the-utilities-script).
```js
const isValid = iti.isValidNumber();
```
Returns: `true`/`false`

**isValidNumberPrecise** ⚠️ DEPRECATED - see [discussion](https://github.com/jackocnr/intl-tel-input/discussions/1840)
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to be careful to keep the plugin up-to-date else you will start rejecting valid numbers. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
**isValidNumberPrecise** ⚠️ DANGEROUS
Check if the current number is valid using precise matching rules for each country/area code etc - [see example](https://intl-tel-input.com/examples/validation.html). Note that these rules change each month for various countries around the world, so you need to be careful to constantly keep the plugin up-to-date (e.g. via an automated script) else <ins>you will start rejecting valid numbers</ins>. For a simpler and more future-proof form of validation, see `isValidNumber` above. If validation fails, you can use `getValidationError` to get more information. Requires the [utils script to be loaded](#loading-the-utilities-script).
```js
const isValid = iti.isValidNumberPrecise();
```
Expand Down

0 comments on commit 5823f6a

Please sign in to comment.