Highlighted

Signature Field State test and action

Avatar

Guest

06-02-2009

I have a form with hidden and visible buttons depending on the state of different fields.



I am currently having a tough time with a signature field.



The starting state of the form would be an unsigned sig field and a "deny" button visible.



When the sig field is signed, I want the deny button to become hidden and the approve button to become visible.



My current code is as follows:



var oSigState = event.target.getField("ManagerApprovalSig").signatureValidate();



if (oSigState == 1)

{

DenyRequest_BTN.presence = "hidden";

ApproveRequest_BTN.presence = "visible";

}



Currently nothing happens when the sig field is signed.



Any help is greatly appreciated.



/cw

Replies

Highlighted

pguerett

09-02-2009

What event is the code running on. Put an app.alert("event fired") as the first line of your code and ensure that your code is being executed when you think it is suposed to.



Are there any errors in the java console (ctrl-J)?
Highlighted

Steve_L_Walker

09-02-2009

Chris,



It may be working. I just ran the following test successfully where a status of 4 was returned from my dig sig change event.



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

if (digSig) {

var status = digSig.signatureValidate();

var message = "";

switch (status) {

case 0:

case 1:

message = "not signed";

break;

case 2:

message = "invalid signature";

break;

case 3:

message = "valid but identity of signer cannot be verified";

break;

case 4:

message = "valid signature";

break;

default:

message = "error";

break;

}

xfa.host.messageBox("Signature status: " + status);

}



Steve



Check out Stefan Camerons blog for the code snippets

http://forms.stefcameron.com/2008/04/18/target-version-reference/

http://forms.stefcameron.com/2006/06/14/acroform-field-name-generator/
Highlighted

Avatar

Guest

09-02-2009

Thank you both for your replies.



The even is on Change and the form:ready event is



this.execEvent("change");



I am getting the app.alert dialog box, so I know it's getting there, but I am not getting anywhere else.



I tried using the code from S L Walker, inserting the "hidden" and "visible" lines in for my button and still nothing.



Any other ideas?