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

Can an LCD Alert Message Have a Check Box like an Acro Alert Message?

Michael Frommer
Registered: Apr 3 2009
Posts: 80
Answered

Is there a way to incorporate the "oCheckBox" argument normally associated with app.alert in an Acro form, as part of the messageBox syntax of an LCD form?

Excerpt from [url=http://acrobatusers.com/tutorials/2006/popup_windows_part1]The Alert Box: Part 1 of 5 on Pop Up Windows[/url]

Quote:

The oCheckbox argument adds a checkbox to the bottom of the Alert Box... In order for it to return a value it requires a generic object literal as input. This object contains 3 properties, the checkbox text (cMsg), an initial value (bInitialValue), and the output value (bAfterValue). The output value is the only required property. The others are optional and have default values.

If not, is there an alternative so my message can have a checkbox so that, if checked, will not display the message alert again?

xfa.host.messageBox("my_text", "my_title", 1, 0);

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can use the app.alert scripting method in LCD too.
Test this code from Thom Parkers sample file in the click:event of a button in LCD.
It generally will work.

  1. // If the global show waring variable is persistant it will be valid
  2. // everytime Acrobat is started, otherwise it will be reset each time
  3. // Acrobat is started. Global Persistance is set by the Configure button.
  4.  
  5. // If our Global show waring variable does not exist, then create it
  6. if(typeof(global.bShowWarning1) == "undefined")
  7. {
  8. global.bShowWarning1 = true;
  9. global.bPersistWarn1 = false;
  10. }
  11.  
  12. if(global.bShowWarning1)
  13. {
  14. // Set up minimal Checkbox
  15. var oCk = {bAfterValue:false};
  16. // Display alert box
  17. app.alert({cMsg:"Don't do that again", nIcon:1,oCheckbox:oCk, cTitle:"Random Warning"});
  18. // Save Show variable
  19. global.bShowWarning1 = !oCk.bAfterValue;
  20. }

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Michael Frommer
Registered: Apr 3 2009
Posts: 80
Radzmar,

Sory for taking so long to acknowledge your response. Your suggestion did work. However, I did get the dreaded "NotAllowedError ; Security settings prevent access to this property or method." I had to write it as a trusted function in a folder level script to get it to work.