We have a situation where we have a form field for a password, but need to mask each character after the user types it. We were able to mask the entire field and transfer the true value to a different field using this code:
$(document).ready(function () {
$(".Dem_Mask input").blur(function () {
//Capture the value entered from the input field
var Dem_Log_In = $(this).val();
//Mask the input field with a string
if ($(this).val() != '*******') {
$(this).val('*******');
//Transfer the value to a second field
$('#q2 input').val(Dem_Log_In);
}
});
});
But now need to do this one character at a time, i.e. as each character is typed. The likely events look like
$(".Dem_Mask input").val().change(function ()
or the js onkeypressevent
Unfortunately, we can't seem to get these to fire while the user is typing in the character box. Are these supported in forms in the way we need?