11 Replies Latest reply on Feb 12, 2013 9:36 AM by KerriBrooke

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

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.

• ###### 1. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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.

• ###### 2. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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?

• ###### 3. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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.

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.

• ###### 4. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

How do you exclude fields?

• ###### 5. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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

• ###### 6. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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....

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.

• ###### 7. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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?

• ###### 8. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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.

• ###### 9. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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?

• ###### 10. Re: Calculate only checked boxes that are checked. Other "lines" of boxes do not have a value. HELPPPPPP

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:

\$