cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Form - to fade oute a Form part

Former Member
0 Kudos

Hello,

what I have:

A Adobe Form with Masterpage and page1 and page2.

an interface with many variables.

Two of them are the name for appraiser1 and appraiser2

Problem:

If the field appraiser2 is empty, the second page shouldn't print.

manual I have made a partform about page2 and under Object it gives the section partform. here I have the chance to fade out the partform with the page2.

How can I do this in the script automatical, if the variable appraiser2 is empty.

Gives a attribute vor visible/output?

Thanks four your help.

regards dse

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dirk,

There are 2 approaches to your requirement.

1) when you say if appraiser2 is null page 2 should not be printed, here why don't you make the page 2 invisible altogether, so if the value to this field is null user sees only page 1 and on print only page1 is printed ...?

2) fine lets say even the appraiser2 value is null you will show all the pages but when you click on the print button you need only the page1 is printed.

here lets say your form is of n pages so if appraiser2 is null page n should not be printed and all the n-1 pages to be printed then replace this below code on the print button click event.

Note: this is in java script


var appraiser2Value = <<form1.form2.subform1.appraiser1.rawValue>>; // this is your apparaiser2 field value.;
var lastPagenNo = 0;

lastPagenNo = (appraiser2Value!= null) ? (xfa.host.numPages -1).toString() : (xfa.host.numPages -2).toString();
//here page number is is calculated by -1 or -2 because the indecx for pages start from 0 in java scripting language.
xfa.host.print(1, "0", lastPagenNo, 0, 0, 0, 0, 0);

Try this out, and let me know if this works out or my understanding your requirement is wrong.

Cheers,

Sai

Former Member
0 Kudos

Hello Sai,

many thanks for your answer.

I have no print button.

The print is controled in the correspondence center. The Application Form controlls the Adobe Form.

And in the interface i have to parameters appraisal1 and apraisal2. And many more data.

My form has to pages. for each appraisal one.

If only appraisal1 is filled, only the first side should be printed.

I have look in the skripting for my page2 to do with FormCalc or javascript to set a parameter/variable of the object page like unvisiple or no_output.

I have hope anyone can tell me the scriptcode with which I can hidden the page 2 if appraisal2 is empty.

Such like in the menue of the form builder in the palette Object - tab Subform - Presence 0 Hidden. Then I can't see the second page. But I see them never.

I want to do in the scripting of page2 befor printing - like this: if no appraisal2 then page2.hidden = true. endif.

I hope you can help me

many thanks

regards

Dirk

Former Member
0 Kudos

Hi,

In this case just design the form in different pages.

Make all the content for apprisal 1 in page 1

And contents of apprisal 2 in page 2.

in form ready event of the field check the field value for null and make its presence as hidden.

at all times what yousee on the screen is only printed so this should work.

I have done a simple example for you which you can download the xdp from the below location.

http://www.mediafire.com/?yjdlprbyi92qz

Check this out and let me knopw for any queries.

Cheers,

Sai

Former Member
0 Kudos

Hi Sai,

many thanks - that was the solution for my problem.

regards

Dirk

Answers (0)