cancel
Showing results for 
Search instead for 
Did you mean: 

Conditionally output of text field in adobe forms

jrgkraus
Active Contributor
0 Kudos
1,563

Creating a form in SFP, I do not find where I can prevent the output of a text field if it is empty. I do not want the field to occupy space in the floating area when it is empty.

I tried to set a condition on the field in the context, but in the output I see that it still occupies space on the page. This makes the output look ugly.

What I am looking for is a similar thing to an "alternative" in SmartForms, where I can omit parts of the layout depending on certain values in the parameters. Can anybody help?

View Entire Topic
jrgkraus
Active Contributor
0 Kudos

I don't get it to work. I created the following script on the text field I want to hide:

data.Main.ACTIONS_5D_TO_7D.DATA.ITEM.d5_7_header.LongTextHeader.Subtitle::ready:form - (JavaScript, client)

if ($.rawValue == null) then 

$.presence = "invisible"

endif

But it has no effect. Did I use the wrong event?

abo
Active Contributor
0 Kudos
We normally use "initialize" for the field
jrgkraus
Active Contributor
0 Kudos
for a test, i wrote it into the initalize event:
jrgkraus
Active Contributor
0 Kudos
for a test, i wrote it into the initalize event (without any condition, only $.presence = "invisible") but the output still occurs
abo
Active Contributor

change type to Formcalc or use the corresponding Javascript

if (this.rawValue == null) { this.presence = "invisible" }

jrgkraus
Active Contributor
Now it works!