1
0
-1

Hi team,

Need to mask the filed like card number / CVV , once the user moves out of the field the data need to be masked. and once user hover they should be able to view it. No we doing while typing the value we are using some "*" for masking, but we need to do as i state above.

thanks

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hi,

      Try putting this code in a Form Load rule (assuming your field name is 'secret'):

      $('#secret').hover(function () {
        $('#secret').attr('type', 'text');
      }, function () {
        $('#secret').attr('type', 'password');
      });

      1. surendarvel

        Thanks Bill this is working fine and i am able to do mask, if i want to unmask last four digit with same scenario,

        Ex. 1234 1234 1234 1234 it should be displayed as ************1234

        so how to perform the above scenario

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hi,

      You could change the logic to use Focus, Blur and Change rules:

      In a Focus rule, put:

          $('#' + item.id).attr('type', 'text');

      In a Blur rule, put:

          $('#' + item.id).attr('type', 'password');

      In a Change rule, put:

          $('#' + item.id).attr('title', ('****************' + data[item.id].slice(-4)).slice(-16));

        CommentAdd your comment...