These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Resetting multi checkboxes

Rkorpel
Registered: Mar 25 2008
Posts: 12

Hey guys,

i am some steps foreward with my PDF document. But now i am fighting a new problem. I have a document with 4 checkboxes on a row. Every checkbox hides/show a subform. They are hidden when u start, and working on the document u call information by pressing a checkbox. With this system only info can be filled in whats needed. The rest stays hidden.

But, if one checkbox is checked, a other checkbox needs to reset and hide again.

I am using this code atm:

Mousedown:

xfa.host.resetData ("subform1_4, checkbox 1_4")

it works, couse he resets the fields. But he also resets other checkboxes. I cant find it whats wrong.

I use this code on Change:

if (Checkbox1_1.rawValue == 1) then
subform1_1.presence = visible
subform 1_4.presence = hidden

else

subform1_1.presence = hidden

endif

also, is it importend to use capitals like the "D"? --> resetData, or can i tjust type resetdata?

Cheers,

Roy

My Product Information:
LiveCycle Designer, Windows
Rkorpel
Registered: Mar 25 2008
Posts: 12
i think my reset code for resetting the checkboxes is okay, but i am putting them on a wrong place in the formCal.
Rkorpel
Registered: Mar 25 2008
Posts: 12
Is there some one that can help me out? :(
R_Boyd
Registered: Nov 1 2007
Posts: 151
If you are using the prescence command then the value should be in quotes

e.g.

subform1_1.presence = visible

The other thing to bear in mind that you should make your references as specific as possible.

An easy way to do this is place your cursor in the script editor and the hold the control key down and click on the relevant subform or field in the design view. Your cursor should change to a V shape and this will paste the absolute reference for you.

The other thing you may want to experiment with is not using checkboxes. If its mutually exclusive you could use a group of radio buttons and format them to make them look like checkboxes.

You can then use the same script idea to change the presence of the subforms. You can set the default value by setting what should be visible/hidden in the formReady event.
Rkorpel
Registered: Mar 25 2008
Posts: 12
Thx again R_Boyd for the Quality reply!

Radio buttons are sofar i have learned the last few days, not ment to be turnt on "and" off.

i also cant fint that script editor where ppl are talking about. I must look over it i gess..

The problem is that i have 14 days with each 4 choices (4 checkboxes in a row) Every checkbox has a function for filling in worked hours (overwork)

choice 1 = 100%
choice 2 = 125%
choice 3 = 150%
choice 4 = 200%

the user fils in how many hours he worked that day. We are trying to tackle mistakes by turning everything off so the user only select what he needs to. If he pics choice 4, choice 1 and 2 need to be disabled so the user can't fill those fields. If the user pics choice 1, choice 4 needs te be disabled.

With this system making mistakes are minimized (thats the idea behind it)

The problem is not the code anymore for hiding and showing fields (subforms) my problem atm is the checkbox itself. So if the user checked choice 4, choice 1 and 2 hides (i fixed that) i need the code that uncheck checkbox 1 and 2.

I hope i made myself clear with my perfect english :)

Thx sofar, i hope u can back me up with this Boyd! ;)