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

Using FormCalc for Null and Visible Fields

SV
Registered: Oct 12 2009
Posts: 5
Answered

I am a beginner with FormCalc and am trying to create a form such that if a particular field has no value, the subsequent field is hidden from the user. If the first field has any text value, then the subsequent field is shown with a drop-down list (this sequence would continue, but I am testing this pair for now).
The first sequence when the text field is null works such that the subsequent field is hidden, which is a start ! However, when I enter text in the first field, I automatically get the word “visible” in the second field in addition to my drop down list ! This can be overwritten, but I would rather have the default value in the drop down list show in the field.

How can I just have the field become visible, but not put the word "visible" in there too ? I tried using the rawValue function, as well as using a default in the object value, but it didn’t make a difference.

Here is the script...volunteer2 and work2 are the names of the fields referred to above.

All inputs are most welcome.

Thanks !

—– F.P1.work2::calculate – (FormCalc, both) ———

if (volunteer2.isNull | volunteer2 == “”) then
work2.presence = “invisible”;
else
work2.presence = “visible”;
work2.rawValue = work2.rawValue

endif

My Product Information:
LiveCycle Designer, Windows
xrum
Registered: Feb 25 2009
Posts: 124
why don't you use javascript? i find it to be much more efficient :)
SV
Registered: Oct 12 2009
Posts: 5
Always something new to try...would you know a simple Java script to address my noted challenge ?
Thanks.
xrum
Registered: Feb 25 2009
Posts: 124
if you want to to show a second field, when the first one has text, this is the javascript:

on the exit event, on the first field:

if (this.rawValue = null)
secondField.presence="hidden"
else
secondField.presence="visible"

:)
SV
Registered: Oct 12 2009
Posts: 5
Appreciate the input, much thanks !