Skip to content

Instantly share code, notes, and snippets.

@Bewitchedyegor
Created October 12, 2017 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Bewitchedyegor/da5ba17cfdc19d2321475ee37b0b9116 to your computer and use it in GitHub Desktop.
Save Bewitchedyegor/da5ba17cfdc19d2321475ee37b0b9116 to your computer and use it in GitHub Desktop.
URL mask based on jquery.mask.js
$('#banner_link').inputmask("url", {
mask: "https://www.*{1,20}[.*{1,20}]",
greedy: false,
clearMaskOnLostFocus: false,
clearIncomplete: false,
definitions: {
'*': {
validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~\-]",
cardinality: 1,
casing: "lower"
}
}
}).css('color', '#999');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment