Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Is it possible to print only marked check boxes?

Avatar

Former Community Member
Hello all, please help!

My customer wants to print only marked check boxes from the filled form (some groups of check boxes on my form contain 10 or even 12 check boxes) and in some cases only few check boxes might be checked. My customer wants to economize the paper (whole form contains 12 pages) and print only marked check boxes.

Could somebody to provide me an idea how to do this?

What script can i use for this?

Thank you very much in advance.

Sergei.
2 Replies

Avatar

Former Community Member
I used the following to do the same thing on a form I did.



It is a text field that I am checking, and a subform that I am hiding if there is nothing entered in the field. The code is JavaScript.



if (path1.txtissue.rawValue == null){

path1.sfissue.presence = "hidden";

}



The code you would need is similar, except you are checking the value of a checkbox, and hiding the checkbox.



Don't forget to save the form as a dynamic form.



In order to 'economize the paper', you would need to have subforms set up properly for this to occur as desired. You would need a flowed subform and then the checkbox objects in a child sub form. When one of the child subforms is set to hidden, the flowed subform will re-calculate and move the subforms up automatically, creating your desired effect. This is why I hide the subform above and not the checkbox in the above snippet.



I hope that helps.



Words of warning: Since your form is 12 pages, adding dynamic content will slow the performance of the form.



Cheers,

Stone.

Avatar

Former Community Member
Stone,

I am really appreciate your help. I tried your script with the text field in my test form, but something is going wrong and i still don't have a success. Could you please attach an example of the solution, even with a text field? Sorry for bothering you, but i have a limited experience in Designer.

Thanks a lot,

Sergei.