Validate IP Address In Input Field - jQuery IpInput

Validate IP Address In Input Field - jQuery IpInput
File Size: 15.2 KB
Views Total: 249
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

IpInput is a tiny jQuery IP address validation plugin that can be used to check if a given IP v4 address (or an IP address range) is valid on submit.

See Also:

How to use it:

1. Load jQuery library (slim build is recommended) and the IpInput plugin in the HTML file.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/jquery.IpInput.js"></script>

2. Attach the plugin to your IP input and done.

<input id="ipinput" />
$(function(){
  $('#ipinput').IpInput();
});

3. Specify the color of the IP address when valid/invalid.

$(function(){
  $('#ipinput').IpInput({
    ColorTrue: "black", 
    ColorFalse: "red"
  });
});

This awesome jQuery plugin is developed by witomin. For more Advanced Usages, please check the demo page or visit the official website.