Expand my Community achievements bar.

SOLVED

Erase button

Avatar

Level 1

Hi,

Is it possible dat i can use the erase button for a form but let the text of a couple fields stay, so not erease the whole text...

I hope that you understand what i mean.

Greetings Josh

1 Accepted Solution

Avatar

Correct answer by
Level 10

You need to set the proper name to your Subform..

In this case, Open Heirarchy palette and select the Subform that was highlighted below, and give the name as "Page1"..

Subform Name.jpg

Thanks

Srini

View solution in original post

7 Replies

Avatar

Level 10

Take the two field values into variables and then use the command xfa.host.resetData(); to reset the entire form. Then assign the variable values back tot hose two fields.

Thanks

Srini

Avatar

Former Community Member

You can clear the data out of a field one field at a time. If you have more fields that you want to keep as opposed to clear, then it might make more sense to save the data in those fields into variables, then clear all fields (resetData) then put the data back.

Paul

Avatar

Level 1

Hi,

Sorry for my late respons, but i still have no clue how to solve my problem.
I finished my form and made two tables. The first table must not be erased bij the "wissen" button (this is the erase button), the second button has to be erased by the button so that they can use the form again. I know that the solution is simple, but i can't make it. Can you please help me.
I put the the form in a link.

Greetz Josh

http://www.dedeurderhoop.nl/diabet.pdf

Avatar

Level 10

Josh,

   Replace your code in the click event of the  "wissen" button with the following..

     xfa.host.resetData("form1.Page1.Table3");

Thanks

Srini

Avatar

Level 1

Hai Srini,

This really looks like the solution, and i was enthousiastic. But i tried it and it did not work, it erased both tables. I also selected "click*" in the show field, but this didn't work also. What went wrong?

Greetz Josh

Avatar

Correct answer by
Level 10

You need to set the proper name to your Subform..

In this case, Open Heirarchy palette and select the Subform that was highlighted below, and give the name as "Page1"..

Subform Name.jpg

Thanks

Srini

Avatar

Level 1

Hi,

Such a simpel, but effectief solution. Thank you very much, i am really happy with it! I love this program!

Greetz,

Josh