I have three fields:
1: user selected dropdown(DD1).
2: calculated dropdown(CDD2) that is set based on the rawValue of DD1. Note: All the display value's and the rawValue's of both DD's are numbers
3: numeric field(NF1) that needs to use the display value of CDD2 in a mathematical equation.
I cannot seem to be able to get the display value of CDD2 in a way that will allow me to get a result in NF1.
From my research it seems that using xfa.event.newText in the change event of the dropdown you want to get the display value from is the way to go, but I cannot seem to get it to generate anything. Is this because it's a calculated field?
It's either that or perhaps I'm trying to use the display value in a way that's not possible i.e. perhaps the display text is being seen as text by the code but I'm trying to use it as a number?
For the coding I've done the following:
In CDD2: In the calculate event:
this.rawValue = DD1.rawValue
In the change event:
var DisVal = xfa.event.newText
// I then tried to place the Display text value from CDD1 into a separate field(SF1)
Page1.SF1 = DisVal
In NF1 In the calculate event:
// Grab the rawValue of SF1, which is supposed to be the display value of CDD2, and plug it into the equation
if (SF1.rawValue > 0) {
SF1.rawValue/(99/7.5);
} else {
"";
}
It's a bit clunky but no matter what I try I can't seem to be able to get the display value in CDD2.
Any help would be appreciated.
Thank you.