Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How can I count only text fields that have been used?

Avatar

Level 2

Hi,

I'm using Livecycle Designer for a dynamic form.  I have a section of the form that contains field for the user to enter goals and then rate the goal.  I'd like to count only the text fields with entries and then have the total number of rates divided by the number of text field entries.

Row 1 , column 1 -- Goal is to pick up 5 apples.   Row 1, column 2 - the rate given is 5

Row 2, column 1 - Goal is to pick up 5 pears.  Row 1, column 2 - the rate given is 5

Two goals for a total rating of 10     ---  10 divided by 2 = 5

Is it possible to count only those fields that are populated?

Also, is it possible to create an error message if the user entered 5 goals but only rated 4 of them?

1 Accepted Solution

Avatar

Correct answer by
Level 7

Please send me the form at

allendavid@co.kane.il.us. I'll get it fixed up for you and send it back and then you'll have the code as a sample for future reference.

View solution in original post

23 Replies

Avatar

Level 7

No problem. I'll send you an email tomorrow morning, hopefully with the form attached and working properly. If it's not working exactly right you'll have an answer why.

Dave Allen

IS Tech

Kane County Circuit Clerk

630.208.2151

Avatar

Level 7

Good morning Kathleen,

I sent you the updated form a few minutes ago, the totals and average now work properly in the new section. The values in the drop downs needed to be converted from strings to numbers in order for the calculations to work.

Good luck,

djaknow

Avatar

Level 2

Hi, Thank you so much for all your help. It's wonderful!!!