I need to stop people from printing the form. The whole purpose of having the electronic form is to save paper. People are printing multiple copies and we don't want them to do it. I may need the capability of printing at some point, so I tried a script I found in the forum...but it's not working. Basically, I have a field that I want a specific value typed in, like a password. If that is correct, they should be able to print the form. Here is the code I used:
app.alert("You cannot print this form. See Greg or Denise for questions.");
xfa.event.cancelAction = true;
In this case, it will pop up the box telling them they can't print if they don't type xxx333 into the text field. However, it still pops up the print box after that, so they can still print. I was hoping the cancelAction script would take care of that, but it doesn't seem to do that. Is there a way to get this to work?
I tried it on a form here and it worked fine ....are you expecting it to work after I enter th epassword? Rememeber that th euser has to invoke a print before one can be cancelled. I woudl remove the else portion .....there is no need to print again ..the user already hit print to start this process in the first place.
I included my sample .....the code is on the prePrint of the password field but you can put it on any prePrint event.