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

Reset a specific field

Avatar

Avatar
Validate 1
Level 2
jahantech
Level 2

Likes

5 likes

Total Posts

14 posts

Correct Reply

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

Avatar
Validate 1
Level 2
jahantech
Level 2

Likes

5 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
jahantech
Level 2

02-08-2018

Hi

I want to reset only "passwordString" text field. But below code reset total form instead of resetting only "passwordString" field.

form1.page2.passwordHash::calculate - (JavaScript, client)

soHASHING_SHA256.hex_sha256(passwordString.rawValue)

form1.page2.passwordHash::mouseEnter - (JavaScript, client)

if(form1.page2.passwordHash.rawValue == null) {

form1.page2.passwordString.presence = "visible";

} else {

form1.page2.passwordString.presence = "hidden";}

form1.page2.passwordHash::mouseExit - (JavaScript, client)

var f1 = "xfa.form1.page2.passwordString";

xfa.host.resetData(f1);

Any help pls.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

02-08-2018

You could just simply use - this.rawValue = null;

Wouldnt that do the same thing?

Answers (3)

Answers (3)

Avatar

Avatar
Validate 1
Level 2
jahantech
Level 2

Likes

5 likes

Total Posts

14 posts

Correct Reply

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

Avatar
Validate 1
Level 2
jahantech
Level 2

Likes

5 likes

Total Posts

14 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
jahantech
Level 2

05-08-2018

Thanks to All of you who replied. But MinusZero's reply was very simple.

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,072 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

02-08-2018

Hi there,

the solution above is good. Also know that you can use the somExpression property of the field to specify its path.

Like the following :

for multiple fields use commas by concatenating somExpressions together...

Avatar

Avatar
Validate 1
Level 3
lateniteNC
Level 3

Likes

12 likes

Total Posts

98 posts

Correct Reply

13 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
lateniteNC
Level 3

Likes

12 likes

Total Posts

98 posts

Correct Reply

13 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
lateniteNC
Level 3

02-08-2018

When only resetting a single field or a limited number of fields on a form, I have always used the reset button, then altered the code to select on the field(s) I wanted removed. Note that I have always used the full address of the field and " " around the field name.

xfa.host.resetData("form1.#subform[0].TextField3");

Example can be found here:  Dropbox - Sample2.pdf

In this example, the click button only clears the entry in Textfield3, not all four fields.

Good luck.