PHP Classes

File: assets/plugins/input-mask/jquery.inputmask.phone.extensions.js

Recommend this page to a friend!
  Classes of Kishor Mali   PHP Hotel Booking System   assets/plugins/input-mask/jquery.inputmask.phone.extensions.js   Download  
File: assets/plugins/input-mask/jquery.inputmask.phone.extensions.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Hotel Booking System
Manage the booking of hotel rooms for customers
Author: By
Last change:
Date: 8 months ago
Size: 1,576 bytes
 

Contents

Class file image Download
/* Input Mask plugin extensions http://github.com/RobinHerbots/jquery.inputmask Copyright (c) 2010 - 2014 Robin Herbots Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) Version: 0.0.0 Phone extension. When using this extension make sure you specify the correct url to get the masks $(selector).inputmask("phone", { url: "Scripts/jquery.inputmask/phone-codes/phone-codes.json", onKeyValidation: function () { //show some metadata in the console console.log($(this).inputmask("getmetadata")["name_en"]); } }); */ (function ($) { $.extend($.inputmask.defaults.aliases, { 'phone': { url: "phone-codes/phone-codes.json", mask: function (opts) { opts.definitions = { 'p': { validator: function () { return false; }, cardinality: 1 }, '#': { validator: "[0-9]", cardinality: 1 } }; var maskList = []; $.ajax({ url: opts.url, async: false, dataType: 'json', success: function (response) { maskList = response; } }); maskList.splice(0, 0, "+p(ppp)ppp-pppp"); return maskList; } } }); })(jQuery);