This is due to the difference between validation scripts and calculation scripts.
β
Validation scripts only run when the step is open and are designed to be used specifically for validation, i.e. making sure necessary fields are completed appropriately before allowing the step to be finished. Once the step is finished these scripts never run again and so none of the hide/show happens when you view the form or print it to PDF.
β
The calculation scripts/expressions run again even after the step has been finished. So, the hide/show isn't really being stored. When you view a form in a completed step, the calculation scripts run and that determines which fields are displayed at that time.
β
The solution is to move all hide/show scripts into the form level calculation script and just use the field level validation scripts for actual validation.
Scripts or validations show on PDFs even when hidden in the form
In this article, we explore why hidden scripts or validations still appear in PDFs, even when forms are completed with them hidden.
Y
Written by Yusef Abulaynain
Updated over 4 months ago