Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How do I present partial form data as asterisk when displaying and printing forms?

Avatar

Former Community Member

I have forms which will be generated and passed via email.  When I need to do is capture data say a SS number.  The data will be entered as 123-45-6789 once the data is entered I want to display the field as ***-**-6789.  What’s the best way of going at this?

1 Accepted Solution

Avatar

Correct answer by
Level 6

I'm not sure this will do the trick.  Unless I'm missing something, the password field doesn't allow you to change the way it's displayed. It always shows all asterisks.

I also played with the display pattern for a text field, but it does not allow a '*' to be substituted for a character so that only the first two sections of the SSN show asterisks.

If all else fails, place a text field on the form and add the following FormCalc script to the field's Exit event:

if (Len($) == 9) then

     $.format.picture

= concat ("text{'***-**-", Right($, 4), "'}")

endif

The above should change the visual appearance of the field but leave the actual value intact. 

Additionally, I set the Edit pattern to "text{999?99?9999}".  This allows users to enter "123456789", "123 45 6789" or "123-45-6789".  However be aware that the data is stored without the dashes, e.g "123456789".  If this is not acceptible then you'll have to play with the Edit pattern and probably change the Len test in the script.

View solution in original post

2 Replies

Avatar

Former Community Member

On the Standard palette there is a password field. This will allow you to display a different character for the ones that the user enters but when you ask for the rawValue or look at the corresponding data file it will show the correct values.

Paul

Avatar

Correct answer by
Level 6

I'm not sure this will do the trick.  Unless I'm missing something, the password field doesn't allow you to change the way it's displayed. It always shows all asterisks.

I also played with the display pattern for a text field, but it does not allow a '*' to be substituted for a character so that only the first two sections of the SSN show asterisks.

If all else fails, place a text field on the form and add the following FormCalc script to the field's Exit event:

if (Len($) == 9) then

     $.format.picture

= concat ("text{'***-**-", Right($, 4), "'}")

endif

The above should change the visual appearance of the field but leave the actual value intact. 

Additionally, I set the Edit pattern to "text{999?99?9999}".  This allows users to enter "123456789", "123 45 6789" or "123-45-6789".  However be aware that the data is stored without the dashes, e.g "123456789".  If this is not acceptible then you'll have to play with the Edit pattern and probably change the Len test in the script.