javascript - Use password input with MaskedInput.js -


so have searched around , far have not found answer this. maskedinput.js plugin digitalbush used lot of places lot of masked input plugins. of them seem focus on masking input format , not allowing formatted mask use secure password field. obviously, not true security fix standard business requirement. trying accomplish use html5 password input maskedinput.js plugin. works except dashes represented bullets mask becomes useless. if has solution not hack please let me know. have setup fiddle testing has jqueryvalidate on input these 2 plugins typically found peas , carrots throughout web.

the sample fiddle here

sample:

 <input type="password" class="form-text" name="ssn" id="ssn" required="true" minlength="9" maxlength="9" aria-describedby="ssn-errors" placeholder="social security number" > 

javascript additional logic force validation on blur:

    $("#ssn", "body")             .mask("999-99-9999", {                 placeholder: "",                 autoclear: false             })             .bind("blur", function () {                 // force revalidate on blur jquery.validate                 var frm = $(this).parents("form");                 // if form has validator                 if ($.data(frm[0], 'validator')) {                     var validator = $(this).parents("form").validate();                     validator.settings.onfocusout.apply(validator, [this]);                 }             }); 

my first theory change input type password text on focus , change on blur seems should standard option use password type mask in days of ssns, cc's , other npd required on forms.

your thoughts welcome.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -