Expand my Community achievements bar.

Disable a Signature after Validating Multiple Text Boxes

Avatar

Level 1

Hello All,

I am pretty new to LiveCycle and all the code behind it, but I have managed to cobble together a form that will suit my needs.

I have put in place a "check" on both my print button and signature field to make sure that at least 13 text boxes on the form contain the required information.  The Print button works fine, but my last stumbling block is the signature field.  When using the same if statement in the PreSign event, the blank test fields are highlighted and the error message is displayed, but the user can still sign the document.

How can I disable the signing of the document after the validation checks are completed?

If it matters, below is an example (1 of the 13) of the iff statements I am using in both the Print Button Click event and the Siganture PreSign event.

if ((txtContact.rawValue==null) || (txtContact.rawValue=="")) {

app.alert("Please enter the Contact Name.");

txtContact.ui.oneOfChild.border.fill.color.value = "255,200,200";

}

else {

txtContact.ui.oneOfChild.border.fill.color.value = "255,255,255";

}

Thanks much!

Shane

1 Reply

Avatar

Level 3

Hi,

You can use the below code in presign event of signature field to cancel sign if the txtcontact value is null.

xfa.event.cancelAction = true ;

The complete code would be as below :-

if(txtContact.rawValue==null)
{
app.alert("Please enter the Contact Name.");

xfa.event.cancelAction = true;

}

--- Hope this resolves your issue.