Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

xfa.event.cancelAction

Avatar

Level 3

I'm trying to build in a condition in my Submit button that says if a given selection is No, the user can't Submit.

So it goes something like this:

if(form1.Pg2.RecoSF.RecoSSF.RecoAnswer.rawValue == 2)
{
    xfa.host.messageBox("Recommendation has been declined by Dept Manager.  Form cannot be submitted at this stage.","Recommendation declined",3,1);
    xfa.event.cancelAction == 1;
}

It displays the message, but it redisplays it about 5 times before it finally comes up with 'Submit Cancelled'.

Can anyone help me with the right script to do this?

Thanks,

Peta

2 Replies

Avatar

Level 9

Hi Peta,

Instead of writing xfa.event.cancelAction == 1 . Write xfa.event.cancelAction = 1 as in the previous statement you check the value where in the later you assign the value .

Thanks,
Bibhu.