I have a field that adds the values from several other form fields. The question I have is how do I add another 2 if a certain checkbox is both visible and checked?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
You would need an if/else statement that looks at the value of the checkbox.
This could be in the calculate event of the field that displays the answer:
var tempAnswer = numericfield1.rawValue + numericfield2.rawValue + numericfield3.rawValue;
if (checkbox.presence == "visible" && checkbox.rawValue == 1)
{
tempAnswer = tempAnswer + numericfield4.rawValue + numericfield5.rawValue;
}
this.rawValue = tempAnswer;
You would need to change the object references, etc, but it should give you a structure to work with. We have examples here, some of which include objects with calculation scripts: http://assure.ly/eEPuCM
Hope that helps,
Niall
Views
Replies
Total Likes
Hi,
You would need an if/else statement that looks at the value of the checkbox.
This could be in the calculate event of the field that displays the answer:
var tempAnswer = numericfield1.rawValue + numericfield2.rawValue + numericfield3.rawValue;
if (checkbox.presence == "visible" && checkbox.rawValue == 1)
{
tempAnswer = tempAnswer + numericfield4.rawValue + numericfield5.rawValue;
}
this.rawValue = tempAnswer;
You would need to change the object references, etc, but it should give you a structure to work with. We have examples here, some of which include objects with calculation scripts: http://assure.ly/eEPuCM
Hope that helps,
Niall
Views
Replies
Total Likes
Thanks. I thought it was something like that, but couldn't quite get it right.
Views
Replies
Total Likes