These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Conditionally set variables

ezbie
Registered: Sep 16 2009
Posts: 4

I am trying to set a variable conditionally using a if/then statement but cant seem to get it to work using formcalc
here are a few examples of what I have tried
--------------------------------------

if (textField1.rawValue == null) then
var myVar = "?"
else
var myVar = textField1.rawValue
endif

--------------------------------------

if (textField1.rawValue.isNull) then
var myVar = "?"
else
var myVar = textField1.rawValue
endif

I also tried declaring the variable befor running the if statement using

var myVar

I can seem to get it to set the variable based on wether the text field is empty... It has to be something stupid and simple I am missing.

My Product Information:
LiveCycle Designer, Windows
ezbie
Registered: Sep 16 2009
Posts: 4
so I got it woking dont know what I messed up thought I tried this several times. Anyway here is what works

var myVar
if (textField1.rawValue == null) then
myVar = "?"
else
myVar = textField1.rawvalue
endif