Can you mask a field that might use alphabet and numeric characters. And what if there is no pattern. Let's say I needed to mask a driver's license or an email address. Do you use regular expression within the script?
I have been playing around with the below script...Feel free to rip it apart because I am not sure if I am moving in the right direction.
$(document).ready(function () { $.getScript('https://forms.alliancesafetycouncil.org/forms/js/jquery.mask.min.js', function () { $('.dl input').mask('A', {'translation': { A: {pattern: /\w+/}, } }); $(".dl input").blur(function () { if ($(this).val() == 'Hidden for security reasons') { return; } $(".dl-hide input").val($(this).val()); if ($(this).val() == '') { return; } else if (/\w+/.test($(this).val())) { $(this).val('Hidden for security reasons'); } }); }); });