Block printing

Avatar

28-07-2008

Hi,



i have created an interactive form. Which uses some mandatory fields, now I would like to block the user to print the form while he hasn't filled the mandatory field.



How can I do this?

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

28-07-2008

This is always a difficult subject because there are so many ways to print. If your form provides a print button you can control that, but if the user hits Cntrl-p or hits the print screen key or is inside a browser and prints from the browser then you cannot control that. There are pre and post print events to help you detect when a print is called for (from inside of your form).

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

29-07-2008

So to do a print you will use the xfa.host.print() command. So you can use an if then else structure to check and make sure that your conditions are met. It woudl be something like this:



if (mandatoryfield != ""){

xfa.host.print.....

} else {

app.alert("You still have a required field....");

}