Hi,
I am trying to hide a signature field if the value of another calculated field is less than a certain value. I am attempting to use:
if (TotalRelUpper.rawValue<150) then
signature.presence="invisible"
endif
If I put this formcalc statement in the click section of the calculated field, the signature field presence will change state, but I want it to automatically change state based on the calculated value.
Ideas appreciated.
Thanks!
Did you try placing the code in the Calculate event of the field?
Thanks
Srini
Srini,
Thanks for the info. When I place the following code in the calculate section, the calculation does not work. The signature field is invisible and no value will make it visible.
Thanks,
Stan
form1.#subform[0].TotalRelUpper::calculate - (FormCalc, client)
TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue
if (TotalRelUpper.rawValue<150) then
VPsignature.presence="invisible"
endif
Views
Replies
Total Likes
Stan,
You are missing the else part in the code..
TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue
if (TotalRelUpper.rawValue<150) then
VPsignature.presence="invisible"
else
VPsignature.presence="visible"
endif
Thanks
Srini
Views
Replies
Total Likes
Srini,
Even with the else statement, the code does not work in the calculate section.
form1.#subform[0].TotalRelUpper::calculate - (FormCalc, client)
TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue
if (TotalRelUpper.rawValue>150)then
VPsignature.presence="visible"
else
VPsignature.presence="invisible"
endif
The calculated field is read only and is the sum of two other fields filled in by the user. I want to have a signature field appear or disappear based on the value in the calculated field.
Thanks,
Stan
Views
Replies
Total Likes
try putting it in the layoutReady event
Views
Replies
Total Likes
Thanks for the suggestion. I tried placing the code in several of the layoutready events, to no avail. There has to be a simple solution, but as a novice in form building, it eludes me. Other inputs are welcome.
Thanks
Views
Replies
Total Likes
Hi Stan,
You just need to make sure the last expression evaluated to the calculate event it the one you want in the result, so you can do;
TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue
if (TotalRelUpper.rawValue>150)then
VPsignature.presence="visible"
else
VPsignature.presence="invisible"
endif
TotalRelUpper.rawValue
The last line can set there like that, or you could do;
var total=UpperNFC.rawValue+UpperExp.rawValue
if (total>150)then
VPsignature.presence="visible"
else
VPsignature.presence="invisible"
endif
TotalRelUpper.rawValue=total
Regards
Bruce
Views
Replies
Total Likes