Mask Credit Card with JSF

Asked

Viewed 70 times

1

I would like to mask on the screen the user’s credit card number for this format #######*****####. But when using this Pattern it pushes the numbers to the right and does not replace them. Does anyone know if you have a Pattern that replaces the element? I’m using it like this.

<h:outputText value="#{produtoBean.produto.numCartao}">
    <f:convertNumber pattern="######******####"
</h:outputText>

Example: For the card 0123456789012345 it is masking like this: 012345****6789 and the correct would be 012345****2345.

Note: I don’t have the option to format in the back end I have to do on the front.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.