Expand my Community achievements bar.

Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

Avatar

Level 2

I have say 6 possible lines. Each line will allow the user to enter employee goals. Then to the right of that, there are radio buttons that the user will check, marking the percentage that particular goal is complete. However, not every employee will have 6 goals, they may only have 3 and some may have all 6 or say, 2. What I want to do is only calculate those lines which have a goal and a percentage marked. So in the end, I want to total the checked boxes which will each have a value and then divide that by the number of goals for that particular employee.

PLEASE, explain this to me so I can understand it. Like I said, I am extremely new to creating forms and LiveCycle. I really hope I can get the answer to this.

Thank you in advance.

11 Replies

Avatar

Former Community Member

At first I recommend to you to use Checkboxes instead of RadioButton. Reason is, that RadioButton can not be unselected by clicking on themselves.

Secondly: Why do you limit the possible entries to 6? Or is this just to explain the problem?

If I were you I would calculate the value of each line in the "Exit" event of the percentage field and write the result in a hidden field in the same line (I suppose you do have a weighting and a percentage to calcualte, right? Is it about staff appraisals?).

You will then have the sum of each line in a hidden field.

All you have to do then is running through all those hidden fields and summarize them in case the checkbox is ticked.

Avatar

Level 2

Thank you for your response. I am limiting my enteries to 6 because we want up to 6 goals listed. No more. Each goal written in will then be evaluated and marked within that line as 0, 25, 50, 75 or 100 % complete. Each of those will have a value of 1-5, depending on which percentage is checked. Then let's say that only 3 goals were designated for that employee, I want to be able to add the boxes up and divide it ONLY by the number of goals for that individual. This various upon employee and the amount of goals. For the other boxes (percentage boxes) I do not want them calculated into the final number because a goal was not assigned to that line if that is the case for that employee.

Can you explain to me the difference between radio buttons and checkboxes? It seemed as if I could desginate a value with a radio button and not a check box. Plus I only want one option to be selected.


When you speak of the "exit" event, can you explain what that means?

Does this make sense?

Avatar

Former Community Member

Ok i thought it should be possible to tick and untick such a RadioButton. If this should really be a single of 5 selection you will be fine with radiobuttons.

Please see this reference for events on fields.

http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=000753.html

I would suggest to calculate the values by script in the exit event the percentage field. This means that calculation is always done when the user leaves the field.

When scripting the calculation you can exclude the goals that shouldn't be added to the summary.

Avatar

Former Community Member

Can you post your calculation script? I think it's easier to explain this way

Avatar

Level 2

I do not even understand most script or even what I am doing now, let alone posting the script you ask for.

Here is what the part of the form that I have questions about looks like at the moment....sample.jpg

The Overall Goal Completion field will be the total of the lines added together. But ONLY any lines that were desginated with a goal. I don't want the other lines to have a value of zero because I don't want to calculate any line that doesn't contain a goal.

Avatar

Level 2

Also, how do I edit the text that is already in this form from Acrobat Pro? Pro tells me that now I can only edit in LiveCycle? Also, how can I edit the lines?

Avatar

Former Community Member

You can not edit text lines of dynamic forms after generating the form. You can only edit fields that are configured to be user editable. Usual text isn't.

You will need a kind of scripting for your requirement of goal overall calcuation, because you need to exclude the lines without a goal. You can create these scripts in the LiveCycle Designer.

Back to Radiobutton/Checkbox Topic: Now where I see your designed form you need RadioButtons. I had a different picture in mind.

Avatar

Level 1

I was interested to see that other people cannot edit text in forms that were made in Acrobat Pro 11 as well.   Pro 11 says that it can not edit the form but to use lifecycle designer.   Lifecycle Designer ES3 will not give me the ability to edit text (this same form)   HOWEVER ES2 v 9.0 I can!! 

Is there a way to edit the text in the form in ES3 without needing to revert back to ES2?

Avatar

Level 2

And NOW, when I am attempting to put in my script for the radio buttons that have values, the area where it should total is NOT correct. This is my script:

 

$

=Page1.RadioButtonList.unlead1+xfa.resolveNode("Page1.RadioButtonList.#field[1]")+xfa.resolveNode("Page1.RadioButtonList.#field[2]")+xfa.resolveNode("Page1.RadioButtonList.#field[3]")+

xfa.resolveNode("Page1.RadioButtonList.#field[4]")

The area that has the total, only has the number 5 in it when I click on the first checked box. (radio button) however, the value is set at one. PLEASE help, I am about to rip my hair out.

Avatar

Level 2

But how do you exclude the lines not used so that I am only adding the lines which have goals and dividing by the number of goals?