Require 2 of 3 radio buttons to have same value for use in calculation

Avatar

Avatar

SciMax

Avatar

SciMax

SciMax

24-11-2015

Background info:

I am using LiveCycle Designer ES2.

I have 4 fields - three radio button groups with 3 items each; and one numeric field that calculates the sum of the 3 radio button group values.

Each radio button group has the same 3 items:

  1. "Claimed" with a value of 10;           This means the person is reimbursed this amount.
  2. "Provided" with a value of 0; and      This means the meal was provided at the event, and the person is not reimbursed.
  3. "N/A" also with a value of 0.            This means the meal is not eligible to be reimbursed. 

The numeric field (Claimable amount) has this JS calculation - parseInt(pfdBreakfast.rawValue) + parseInt(pfdLunch.rawValue) + parseInt(pfdDinner.rawValue);

Question:

Is there a workaround to allow 2 radio buttons in the same group to have to the same value?    OR   Is there a totally different method to obtain the results I need?

Note:  I tried putting "1" for the N/A value but, of course, each N/A value was added to the sum.
          I also tried putting "N" for the N/A value but the numeric field calculation wouldn't work at all.

RadioButtonError.PNG

Thanks for any assistance you can provide.

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

24-11-2015

Hi,

Here's a couple of ways, if you leave the values as the default, that is 1,2,3,... you could use;

[10,0,0][pfdBreakfast.rawValue - 1]

That is get the business value from an array.

You could also change the binding value of the N/A radio button to "0.0" and let the parseInt that you already have turn it back to 0.  The binding values of radio buttons are strings by default.

Regards

Bruce