Skip to main content
This topic has been closed for replies.

2 replies

Inspiring
October 9, 2016

lYou will need 4 named fields. You will have one group 2 check boxes named "Percent", a group of 2 check boxes named "Meal" and a group of 5 check boxes name "Weekday". For the 2 check boxes named "Percent"  one will have an Export Value of "25" and the other "50'. For the 2 check boxes named "Meal" one will have an export value of "lunch" and the other "dinner". For the 5 check boxes named "Weekday" each one will have an export value for day of the week the button is associated with. The fourth field will be a text field with a name of "Response". The field will be "read only" and use a "Calculation" in the "Custom JavaScript calculation" of:

event.value = "";

var cPercent = this.getField("Percent").value;

var cMeal = this.getField("Meal").value;

var cWeekday = this.getField("Weekday").value;

if(cPercent != "Off" && cMeal != "Off" && cWeekday != "Off")

{

event.value = "The man ate " + cPercent + "% of his " + cMeal + " on " + cWeekday + ".";

}

try67
Community Expert
Community Expert
October 9, 2016

Let's say the two fields shown here are called "Answer1" and "Answer2", and that you've set the "Radio Button Choice" value of each widget in the group to the desired text. You can then use a custom calculation script to populate a (read-only) text field with the combined value. It will look something like this:

var a1 = this.getField("Answer1").valueAsString;

var a2 = this.getField("Answer2").valueAsString;

if (a1=="Off" || a2=="Off") event.value = "";

else event.value = "The man ate " + a1 + " of his lunch on " + a2;