Skip to main content
zacb85173355
Known Participant
September 24, 2016
Answered

Using password to show/hide forms - any way to retain "doesn't print" setting?

  • September 24, 2016
  • 2 replies
  • 503 views

I got a script from George_Johnson that allows me to enter a password to show/hide selected fields (buttons actually).  It works perfectly, but when I enter the password and the buttons re-appear, their General/Common Properties setting reverts back to "visible" instead of "visible but doesn't print", and the buttons show up when I print the document out.  I was thinking I could change these lines and keep the buttons from printing...

case "password": // Your password goes here

        getField("x").readonly = readonly;

        getField("x").display = readonly ? display.hidden : display.visible

        app.alert("Level 1 support is now " + readonly_desc + "d.", 3);

        break;

...by changing the 3rd line to read like this:  getField("x").display = readonly ? display.hidden : display.visible but doesn't print;  (or _but_doesn't_print;)

but then I started getting syntax errors in the 4th line.  I don't know java at all, but I thought I might get lucky.  Am I getting warm?  Is it the "3" that needs to change?  Or is what I've started completely wrong?

Thanks for reading,

Zac

This topic has been closed for replies.
Correct answer try67

You can't just guess at what the value might be and hope for it to work... You need to consult the documentation.

In this case what you're after is "display.noPrint".

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 24, 2016

You can't just guess at what the value might be and hope for it to work... You need to consult the documentation.

In this case what you're after is "display.noPrint".

zacb85173355
Known Participant
September 25, 2016

That works much better lol, thanks, that solved my problem.  Your tab delimited solution is still working great too btw.  I've just taken to editing the .txt file directly, seems to work fine.  thanks for the help.