Expand my Community achievements bar.

using messageBox in locking fields

Avatar

Former Community Member
I've got a form that's functioning somewhat like an index. When data is filled in for a particular entry, it needs to be locked down. My strategy for accomplishing this is using a button with scripting to set the access on those particular fields to ReadOnly.

This all works great -until I try to add in a variable of a messageBox in which the user gets a warning and is allowed to back-out of the lockdown to make changes as needed. It seems that using hte messageBox is an all or nothing proposition -I can't figure out how to access the "okay" or "cancel" buttons to create behavior from there. Everything I try either locks the fields or does not allow the locking regardless of the button pressed.

Can anybody point me in the right direction here?

Thanks!

Jennifer
3 Replies

Avatar

Former Community Member
Take a look at page 594 of the XML Forms Object Model Reference. You'll see what the return values for xfa.host.messageBox() are, and that they are based on what button is clicked by the user. Hope that helps.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Chris,

How do you access that return? I've got the message box working with the right buttons -but I still can't access the return value to make any further conditional stuff happen.

Any suggestions?

Thanks!

Avatar

Former Community Member
Something like this:



var returnValue = xfa.host.messageBox(...);



Then the possible return values are:



1 (OK button)

2 (Cancel button)

3 (No button)

4 (Yes button)



Chris

Adobe Enterprise Developer Support