Hello --- hope you are all enjoying the holiday season.
I'm working on a fillable pdf form for my office mates to use as a cover sheet for certifying invoices for payment. I have a few fields which must be filled in for the finance team to accept the document. I also have a document signature field so the form filler can sign the coversheet (our office has certificates all set up). I'm using LiveCycle Designer (LCD) on an enterprise so I have no control over when/if I'll ever have a later version. The one I have is whatever comes with Acrobat 8.x (pertinant becasue it does not have preSign and postSign events with signature fields).
I'm trying to have the form check that the required fields are non-empty before the document is signed and prevent a signature on an incomplete form. I was envisioning an appropriate little script in some event on the signature field. Should be easy, right? Well, I wouldn't be posting if I'd succeded
The solutions I've tried are listed below. They each fall short --- maybe some one can help make one of them work, or maybe some one has a different approach that will work. I'm all ears. I'm happy to admit that some good old RTFM may be involved, but I'd appreciate a pointer to which FM to RT. I have experience coding (mostly in C/Perl) but am pretty green with java.
Thanks for you time !!
Gordon
form1.#subform[0].button::click - (JavaScript, client)
if( RequiredTextField.rawValue != null ) {
// reveal the obsecured sig field by making the button invisible
button_subform.presence = "invisible";
// fire off the digital signature
SignatureField.execEvent("click");
}
else
{
// keep hiding access to the signature field
xfa.host.messageBox("Please fill in all required fields");
}
It didn't work. I later found a post in which some one said that the digital signature process flow is complicated and that a genuine user click is not the same as a click from javascript. Presumably it work for the button case.
Views
Replies
Total Likes
Hey mate,
Did you find a solution to your problem? Or did you have to go with the double click option in the end?
I am using LCD ES2 and am keen to ensure that a drop down list and date field are non-empty before signing is allowed (pretty similar to your case) but have not had any success. Doesn't look like a standard signature field will allow these sort of actions in the pre-sign event?
Cheers,
Adam
Views
Replies
Total Likes
I've put a bit of a solution to this at
http://users.cecs.anu.edu.au/~gmcintyr/example.xdp.zip
based on something I saw a few years ago. The form has 3 account fields. Leave one or all of them empty, click on Submit and it will give you a message and then, add them to an error list. In a bigger application, like the ones I work on, I'd add other types of validations to the list.
Views
Replies
Total Likes
Hi Adam,
No, I never figured it out before I had to move onto other stuff. I went
with the double click (the form is meant for a small group so I can do some
human management).
That said, I did get an e-mail from forms@adobe the same day you wrote to me
mentioning a partial solution. Here is the text (including a link)
I've put a bit of a solution to this at
http://users.cecs.anu.edu.au/~gmcintyr/example.xdp.zip
based on something I saw a few years ago. The form has 3 account fields.
Leave one or all of them empty, click on Submit and it will give you a
message and then, add them to an error list. In a bigger application, like
the ones I work on, I'd add other types of validations to the list.
I have not checked it out, but maybe it can help you. Let me know if it
does. I'll peak at it when I get some time.
Good Luck!!
Gordon
PS: where you writing from? "Hey mate" suggests you might be from "down
under"
Views
Replies
Total Likes
Thanks for replying Gordon,
You've correctly guessed my location =P, I'm writing from Western Australia.
In the example you attached It appears that only buttons have been used
(i.e. no signature fields) however some of the code or the approach may
still be useful - I have only been able to have a quick look myself at this
point (have been out of the office lately).
Our form is also intended for a fairly small group and so I may also go with
the double click option.
I'll let you know how it works out.
Thanks again,
Adam
Views
Replies
Total Likes
Hi Adam,
Just re-read your requirements and realised I would do it different from the original question. I would make the signature field read only until something is entered in the mandatory fields.
You could do it this way. In the signature field's Initialize and Calculate events, I would add the following scirpt
//if both fields have something in them make signature field updatable
//otherwise set it to readOnly
If ((field1.rawValue != "" && field1.rawValue != null) && field2.rawValue != "" & field2.rawValue != null) {
this.access = "open";
} else {
this.access = "readOnly";
}
Gordon
Views
Replies
Total Likes
Adam
Views
Replies
Total Likes
When I attempt to use your example code, I receive error on syntax check...
//if both fields have something in them make signature field updatable
//otherwise set it to readOnly
If ((field1.rawValue != "" && field1.rawValue != null) && field2.rawValue != "" & field2.rawValue != null) {
this.access = "open";
} else {
this.access = "readOnly";
}
Error: syntax error near token '!' on line 3, column 22
Any ideas why this is? Any help would be greatly appreciated.
Thanks
Views
Replies
Total Likes
I tried to use this to solve a related issues where multiple fields must have a minimum value.
//if all fields have their target value or greater in them make signature field updatable |
//otherwise set it to readOnly
If (ASTM1.rawValue >= 4 & ASTM2.rawValue >= 5 & ASTM3.rawValue >= 6 & ASTM4.rawValue >= 3 & ASTM5.rawValue >= 2 & ASTM6.rawValue >= 8 & ASTM9.rawValue >= 1 & ASTM10.rawValue >= 3 & ASTM11.rawValue >= 1 & ASTM12.rawValue >= 0) {
this.access = "open"; |
} else {
this.access = "readOnly"; |
}
Error: syntax error near token "{" line 5, column 227
Views
Replies
Total Likes
Views
Likes
Replies