I was wondering if someone could provide me with the syntax for formcalc for the following javascript. This is used to hide or make visible 2 fields based on a value in a drop down list:
switch(xfa.event.newText) {
case 'A - Approved':
form1.Page1.2nd_Title.presence = "visible";
form1.Page1.2nd_Signature.presence = "visible";
break;
default:
form1.Page1.2nd_Title.presence = "hidden";
form1.Page1.2nd_Signature.presence = "hidden";
break;
}
Thanks,
Mallard27
Solved! Go to Solution.
Views
Replies
Total Likes
Sorry, no simple switch-like statement in FormCalc, although there are convoluted ways to simulate it. For your example the easiest is if/then/else:
if (xfa.event.newText == "A - Approved") then
form1.Page1.TextField1.presence = "visible"
form1.Page1.TextField2.presence = "visible"
else
form1.Page1.TextField1.presence = "hidden"
form1.Page1.TextField2.presence = "hidden"
endif
Also, not sure if you can have object names that start with a number, like "2nd_Title".
Views
Replies
Total Likes
Sorry, no simple switch-like statement in FormCalc, although there are convoluted ways to simulate it. For your example the easiest is if/then/else:
if (xfa.event.newText == "A - Approved") then
form1.Page1.TextField1.presence = "visible"
form1.Page1.TextField2.presence = "visible"
else
form1.Page1.TextField1.presence = "hidden"
form1.Page1.TextField2.presence = "hidden"
endif
Also, not sure if you can have object names that start with a number, like "2nd_Title".
Views
Replies
Total Likes
I think I asked the wrong question but you have the right answer. I just realized the switch(xfa.event.newText) is formcalc...I misread this the first time which means I really have no question...but your solution would work.
Thanks,
Mallard27
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies