Hello, say I have the following checkboxes:
A
B
C
D
With only the checkboxes that are ticked showing up on printed copy. Say only C & D are checked, as I have it now there is a lot of space between the previous field and C & D with A & B not printing. Is there a way to move these boxes up to the top to decrease the blank space?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Ah! Yes, that's probably it. You'll need to mark those fields as "hidden" in the prePrint event as well.
Views
Replies
Total Likes
Hi,
What code are you using to print the checked checkboxes? and in what event? You can set the presence property of the checkbox to hidden which will remove it from the layout of the form, or set it to hidden which will not display the checkbox but will still take up space on the form.
Regards
Bruce
Views
Replies
Total Likes
First, you need to have the fields within a sub-form where the Content is set to "Flowed" rather than "Positioned". That way, when a field is "hidden", the other fields will move up to fill the space.
Next, for each of the checkboxes, you should add some JavaScript code to the prePrint event that make the field hidden if it is checked, something like this:
if (this.rawValue == 1) {
this.presence = "hidden";
}
Lastly, for each of the fields you will need some JavaScript in the postPrint event to display it again after the document is printed, like this:
this.presence = "visible";
Views
Replies
Total Likes
Thanks but no luck yet. Wrapped each box in a flowed subform and no dice.
I have checkboxes arranged and when one is checked, a field right below it is set to appear but stays hidden if not checked. This is my scrip for pre-print:
if(CheckBox22.rawValue == false)
{
CheckBox22.relevant = "-print";
}
It is a list of 11 checkboxes, just thought it would be nice for instance to have checkbox #8 move up to the top if #1-7 are not checked.
Thanks.
Views
Replies
Total Likes
You said you "Wrapped each box in a flowed subform". Just to make sure there's no confusion here, all of the checkboxes are together in ONE flowed subform, not each checkbox alone in their OWN subform, right? Just checking.
Using .relevant = "-print" prevents the object from being printed, but does NOT cause it to stop using up space in the layout. .presence = "hidden" does the latter, so try using that. You'll then need to have .presence = "visible" in the corresponding script for the postPrint event, so that it will show up on the screen again after the document has been printed.
In the prePrint event:
if (CheckBox22.rawValue == false) {
CheckBox22.presence = "hidden";
}
In the postPrint event:
CheckBox22.presence = "visible";
Actually, if you have this code on the events for CheckBox22 itself, you can just use "this", so the code would be:
In the prePrint event for CheckBox22:
if (this.rawValue == false) {
this.presence = "hidden";
}
And in the postPrint event for CheckBox22:
this.presence = "visible";
Views
Replies
Total Likes
Fixed some typos in my reply.
Views
Replies
Total Likes
Thanks but still nothing. Space remains. All checkboxes are wrapped in flowed subform, tried both pre-print and post-print scripts.
Views
Replies
Total Likes
Are you saving it as an "Adobe Dynamic XML Form"? If you're saving it as a static PDF, it won't work.
Try testing it out on a new form (just a few checkboxes in a flowed subform) and confirm that you can get it to work there, then see whether you can get it to work in your real form.
Views
Replies
Total Likes
It worked on a new form, but no fields were between the checkboxes- I think that is the problem. I have hidden fields between the checkboxes that only appear if the previous checkbox is checked.
Views
Replies
Total Likes
Ah! Yes, that's probably it. You'll need to mark those fields as "hidden" in the prePrint event as well.
Views
Replies
Total Likes
Got it. Thanks a million Wally. I appreciate it.
Views
Replies
Total Likes
Great! Glad to hear it's working!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies