Avatar

Level 1

Varma_LC,

Thank you for responding but I guess I'm still missing something because I can't get any code to trigger.  I put a simple conditional statement in the click event of a regular button and it doesn't trigger.

So to make sure I'm getting this right, first of all, I'm using LifeCycle Designer 8.  I've created a regular button (type button, control type regular).  In the click event I have the following:

var tValidate = true;
var tMsg = "";

if (NOT(isEmpty(myField1.rawValue)))
{
  app.alert("myField1 has a value of - "+myField1.rawValue+".");
  if (isEmpty(myField2.rawValue))
  {
    tMsg = "Specify a value for myField2.";
    tValidate = false;
  }
}

if (tValidate == false)
{
  xfa.host.messageBox(""+tMsg,1,0);
  exit;
}

All of my objects are at the same level in the hierarchy so should be accessible without fully qualifying their names.  The above code works in the form validate event (I was throwing it into all sorts of objects/event to get it to trigger from somewhere) so I know the code itself works (testing it be supplying something in myField1 but not in myField2).  It just doesn't trigger from a button (and I've tried various events in an email button all of which failed).

So 'any' help directing me to why this doesn't work so that I can start writing all my validations would be so appreciated!