These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Problem with app.response in LCD

Zeynep
Registered: Nov 29 2008
Posts: 21
Answered

Hi everybody,

I have a form with an "office use only" part and from discussions on this forum I figured out how to make a button with a password that switches certain fields from 'open' to 'readonly' and throws an error message if PW is incorrect.

BUT, it throws the same 'invalid PW' message when I press cancel.
I tried adding a

"if (btn != '')"
or "if (btn != 0)"
or "if (btn!= 2)" (I read somewhere the return value for cancel is 2 ?)

But none of those worked. What can I do so that the dialog box just closes when 'cancel' is pressed?

TIA,
Zeynep

My Product Information:
LiveCycle Designer, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
It would help a lot if you were to post more of your script, but in general, it should look something like:

var btn = app.response("Enter password"); if (btn !== null) {// Code to check for correct password goes here } else {// User pressed the Cancel button// No code is necessary here if you want nothing to happen}

George
Zeynep
Registered: Nov 29 2008
Posts: 21
Thank you so much, that worked.

I was trying to add that line with "0" instead of "null", apparently they're not interchangeable like I thought :)