Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to mask a string with asterisks (*) when printing?

Avatar

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile
JainSa
Level 1

12-10-2018

Dear Expert,

Kindly give me solution below the issue.

I have created two field 2 in Adobe LiveCycle Designer --> Text Field 1 in that text field enter the value manually like(123434567890)

i need to print the field value in Fields number with “*” up to the last 4 digits in adobe forms. (********7890)

how can i write the script code in form calc or js in Adobe LiveCycle Designer .

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
JainSa
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Applaud 5
Affirm 1
View profile
JainSa
Level 1

24-10-2018

Hi Radzmar,

Thanks for your update.

Below the code run sucessfuly in form calc.

$.rawValue=Concat(form1.#subform[0].B.rawValue, form1.#subform[0].TextField2.rawValue)

Answers (2)

Answers (2)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

13-10-2018

Hi,

all you need is two small scripts in the printed fields prePrint and postPrint events:

prePrint event

if (!this.isNull) {

var cStr = this.rawValue,

cMaskString, cKeepStr, cAsterisk,

iLength = cStr.length;

// Save rawValue as a global variable (don't use var!)

cGlobalStringVar = cStr;

// Replace except the last for characters with asterisk.

this.rawValue = Array(iLength-3).join("*").concat(cStr.slice(iLength-4, iLength));

}

postPrint event

// Restore to original raw value from global variable

this.rawValue = cGlobalStringVar;

Hope this helps.

Avatar

Avatar
Validate 1
Level 1
fcbg1234
Level 1

Like

1 like

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
fcbg1234
Level 1

Like

1 like

Total Posts

35 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
fcbg1234
Level 1

17-10-2019

I need to mask out an Account Number field when printing but can't seem to make ithings work.

Where does your suggestion go under form calc?  Is radzmar's suggestion needed with yours??