Join the Team Forms community

141
members
11
new
J
d
B
R
M

how to hide a component on the PDF if the input is empty

Last updated last month
m
marvin mercado

how can i hide the component in pdf if the value/input is empty

A
Anthony Phan
Marked as solution

To hide a component in the generated pdf only when it has no value you can use the advanced conditional feature to dynamically hide the component.


The instance.isHtmlRenderMode() function will return true for PDF rendering and the instance.getValue() function will return the value of the component. Combining this into a conditional expression will allow you to hide the component in the PDF if there is no response to it as shown below.


JavaScript
if(instance.isHtmlRenderMode() && !instance.getValue())
    show = false
View full solution
A
1 comment
A
Anthony Phan

To hide a component in the generated pdf only when it has no value you can use the advanced conditional feature to dynamically hide the component.


The instance.isHtmlRenderMode() function will return true for PDF rendering and the instance.getValue() function will return the value of the component. Combining this into a conditional expression will allow you to hide the component in the PDF if there is no response to it as shown below.


JavaScript
if(instance.isHtmlRenderMode() && !instance.getValue())
    show = false