Auto Format & Validate IP Address - jQuery IpInputMask

File Size: 5.64 KB
Views Total: 7322
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Auto Format & Validate IP Address - jQuery IpInputMask

A small and dead simple to use input mask plugin for IP that automatically formats and validates IP addresses in “xxx.xxx.xxx.xxx” format when typing.

How to use it:

1. Download and place the JavaScript file mask.ip-input.js after loading the latest jQuery library.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/mask.ip-input.js"></script>

2. Attatch the plugin to the input field and done.

<input id="example"
       ip-mask
/>
$(document).ready(function(){
  $('[ip-mask]').ipAddress();
});

3. Set the predefined IP address.

<input id="example"
       ip-mask
       value="192.168.1.1"
/>

4. Customize the placeholder text.

<input id="example"
       ip-mask
       value="192.168.1.1"
       placeholder="000.000.000.000"
/>

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