ip validator
Validate an IP address. Support both IPv4 and IPv6
← Validators
Options
Option | HTML attribute | Type | Description |
ipv4 | data-fv-ip-ipv4 | Boolean | Enable IPv4 validator, default to true |
ipv6 | data-fv-ip-ipv6 | Boolean | Enable IPv6 validator, default to true |
message | data-fv-ip-message | String | The error message |
When setting options via HTML attributes, remember to enable the validator by setting data-fv-ip="true".
Example
It also supports CIDR notation:
Related validators
The following validators might be useful to you: