Skip to content

Instantly share code, notes, and snippets.

@hatamiarash7
Forked from Bewitchedyegor/url_mask.js
Created May 21, 2019 14:02
Show Gist options
  • Save hatamiarash7/3be6624f66593ad6c96b44bc18a1a535 to your computer and use it in GitHub Desktop.
Save hatamiarash7/3be6624f66593ad6c96b44bc18a1a535 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