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

clear signature but do not unlock previously locked fields

Swat_mpg
Level 1
Level 1

I have designed a form in LiveCycle ES 8.2.1 in which certain fields are locked when a check box is checked. They should remain locked. However, when a first digital signature is inserted and the user clears the signature. previously locked fields get unlocked. These fields must always stay locked.  Does anyone have a solution for this?

Thanks!

5 Replies
SForrest96
Level 9
Level 9

Are you executing JavaScript to lock the fields when the check box is selected?  If so, can you re-run the script to have the fields lock again.  You could check the status of the signature field, if it is unsigned then you could fire the script to lock the fields associated with the check box.

Regards

Steve

Swat_mpg
Level 1
Level 1

I'll give it a try and will let you know.

Thank you!

mpg

Swat_mpg
Level 1
Level 1

I have added the code in Employee Signature field Change event to check the signature status and lock fields if the checkbox is checked . But it is not working.

The requirement is that if the check box is checked, all the fields above that must be locked whether signature is valid or cleared.

This is the first form I have designed in LiveCycle. So I would appreciate any help in this matter.

Thanks,

swat_mpg

-------------------------------------

1. This is the code

form1.SubformMain.SubformText.SubformSignatures.EmployeeSignature::change - (JavaScript, client)

var digSig = event.target.getField(GetFQSOMExp(this));

var status = digSig.signatureValidate();

app.alert(status);

switch (status)

{

case 0:

case 1:

case 2:

if ( form1.SubformMain.SubformText.chkAppraisalComplete === 1)

{

xfa.host.messageBox("Signature status is:- "

& status)

form1.SubformMain.SubformName.txtfLast.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformName.txtfFirst.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformName.txtfInitial.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.txtfDivision.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.txtfPosition.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.txtfTimeInPosition.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.txtfTimeWithSupervisor.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.txtfSupervisor.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.DateFrom.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformGeneral.DateTo.access

= this.rawValue?"readOnly":"open";

txtfA.access

= this.rawValue?"readOnly":"open";

txtfB.access

= this.rawValue?"readOnly":"open";

txtfC.access

= this.rawValue?"readOnly":"open";

txtfD.access

= this.rawValue?"readOnly":"open";

txtfE.access

= this.rawValue?"readOnly":"open";

form1.SubformMain.SubformText.chkAppraisalComplete.access

= this.rawValue?"readOnly":"open";

}

break;

}

--------------------------------------------------

2. Image of the Partial form

EmpAppr.jpg

SForrest96
Level 9
Level 9

swat_mpg

I created a simple sample that, I think, achieves what you want to do.

I created a form that will set the access on some fields to readOnly based on the value of a checkbox (selected = readOnly, un-selected = open)

I then have a signatureField that "onChange" triggers the click event of a hidden button that contains code to set a flag in a field (not required in your case, but I built this sample off of one I created previously) and it sets the Check Box itself to "readOnly" so it cannot be accessed, preventing it's associated fields from being changed back to open, by de-selecting the check box.

Please note that fields can be locked by a signature field by using a field collection (and no script), but the lock is disabled if the signature field is cleared.  For demo purposes, I created a field collection that contains the checkbox and I associated it with the signature field.

Take a look at the attached sample.

Thanks

Steve

Swat_mpg
Level 1
Level 1

Thank you very much for your help.

I tried the code "var oSigState = event.target.getField("form1[0].#subform[0].SignatureField1[0]").signatureInfo().status;".

However, it gave the following error:

event.target.getField("form1.SubformMain.SubformText.SubformSignatures.EmployeeSignature").signatureInfo is not a function

3:XFA:form1[0]:SubformMain[0]:SubformText[0]:SubformSignatures[0]:Button[0]:click

So I substitued that line of code and some more code form another blog with

var

digSig = event.target.getField(GetFQSOMExp(this));

The form is working now just the way it is supposed to. Thanks to you!

swat_mpg