cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a Static Text when three fields are empty in a Subform

Former Member
0 Kudos

I have a Subform and inside that subform three fields and one Static text field for the header. It looks like :

Subform->

StaticText.

Field 1.

Field 2.

Field 3.

Now if all the three fields are empty , then Static Text should hide. If any one field has a value, Static text should appear.

The fields which are empty should also hide.

For individual field to hide when there is no data I have written FormCalc Script :

if ( not hasValue( $) ) then

$.presence = "hidden".

endif

How to hide Static Text when all fields are empty ?

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

Place a Text Field from the library and in Object Pallete make its presence as Hidden(Exclude from Layout).

Goto Script Editor for this field

Event : Validate Script Language: Formcalc

place the below code

if ( not hasValue( subform.field1 ) and not hasValue( subform.field2 ) and not hasValue( subform.field3 ) ) then

subform.StaticText.presence = "hidden"

else

subform.StaticText.presence = "visible"

endif

Thanks,

Madhu.